Jump to content

Recommended Posts

Posted

Hello,

I wish we had an option to disable the "Pages" ("Páginas", in our translation below) option in the search menu. As these fixed pages have no relevant content in our website, this option, being at the top, only creates clutter, taking up unecessary space.

image.png.1826edfca43faf57c3a2e465b54e92c9.png

Note that I've already suggested the same for Products, and here we ended up using a plugin developed by Adriano Faria based on my suggestion to achieve this. My original suggestion to disable Products from search remains! 🙂

 

Thanks,

Gabe.

Posted
11 minutes ago, Daniel F said:

That's a bad approach, instead of overriding the variable, it would be much better to override the getter method ( includeInSiteSearch() )

	public static function includeInSiteSearch()
	{
		return FALSE;
	}

in \IPS\cms\Pages\PageItem?

Posted
13 minutes ago, Adriano Faria said:
	public static function includeInSiteSearch()
	{
		return FALSE;
	}

in \IPS\cms\Pages\PageItem?

Yes.

Reason for this is that we're not using this variable anywhere except inside the getter method.
Other hooks could override the method too, we could literally change the code in the method and not use the variable at all or include some further logic  (e.g. take a look a the implementation in the Record class) so overriding the method will probably be much more future proof.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...