Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted December 13, 20213 yr 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. 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.
December 14, 20213 yr Community Expert You need a plugin to do it: -- ATTACHMENT REMOVED -- Edited December 14, 20213 yr by Adriano Faria
December 14, 20213 yr Author Many thanks @Adriano Faria once again for creating these plugins for us! 🙂
December 14, 20213 yr 33 minutes ago, Adriano Faria said: You need a plugin to do it: Remove Pages from Search 1.0.0.xml 1.4 kB · 3 downloads That's a bad approach, instead of overriding the variable, it would be much better to override the getter method ( includeInSiteSearch() )
December 14, 20213 yr Community Expert 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?
December 14, 20213 yr 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.
December 14, 20213 yr Community Expert 1 hour ago, Adriano Faria said: You need a plugin to do it: -- ATTACHMENT REMOVED -- @Gabriel Torres, I just submitted a fixed version to the markeplace:
December 14, 20213 yr 36 minutes ago, Adriano Faria said: @Gabriel Torres, I just submitted a fixed version to the markeplace: Suggestion: Make it please a per-page option:D
December 14, 20213 yr Community Expert 1 minute ago, Daniel F said: Suggestion: Make it please a per-page option:D Yeah, good idea. Next version. 👍
December 15, 20213 yr Community Expert Not yet. Still missing an update. In the meantime, youu can use the one I attached yesterday.
December 16, 20213 yr Author @Adriano Faria The new plugin is now available at the marketplace. Working great here.
December 16, 20213 yr Community Expert The "products" search is pending; follow the file to get notified. Made the same change indicated by @Daniel F.