Gabriel Torres Posted December 13, 2021 Posted December 13, 2021 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. Claudia999 1
Adriano Faria Posted December 14, 2021 Posted December 14, 2021 (edited) You need a plugin to do it: -- ATTACHMENT REMOVED -- Edited December 14, 2021 by Adriano Faria SeNioR- and Gabriel Torres 1 1
Gabriel Torres Posted December 14, 2021 Author Posted December 14, 2021 Many thanks @Adriano Faria once again for creating these plugins for us! 🙂 Adriano Faria 1
Daniel F Posted December 14, 2021 Posted December 14, 2021 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() )
Adriano Faria Posted December 14, 2021 Posted December 14, 2021 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?
Daniel F Posted December 14, 2021 Posted December 14, 2021 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. Gabriel Torres and Adriano Faria 1 1
Adriano Faria Posted December 14, 2021 Posted December 14, 2021 I will update another plugin that does exactly the same. 👍 Gabriel Torres 1
Adriano Faria Posted December 14, 2021 Posted December 14, 2021 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:
Daniel F Posted December 14, 2021 Posted December 14, 2021 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 SeNioR- 1
Adriano Faria Posted December 14, 2021 Posted December 14, 2021 1 minute ago, Daniel F said: Suggestion: Make it please a per-page option:D Yeah, good idea. Next version. 👍 SeNioR-, Gabriel Torres and Jimi Wikman 2 1
Gabriel Torres Posted December 15, 2021 Author Posted December 15, 2021 @Adriano Faria Not available yet (broken link).
Adriano Faria Posted December 15, 2021 Posted December 15, 2021 Not yet. Still missing an update. In the meantime, youu can use the one I attached yesterday. Gabriel Torres 1
Gabriel Torres Posted December 16, 2021 Author Posted December 16, 2021 @Adriano Faria The new plugin is now available at the marketplace. Working great here. Adriano Faria 1
Adriano Faria Posted December 16, 2021 Posted December 16, 2021 The "products" search is pending; follow the file to get notified. Made the same change indicated by @Daniel F. Gabriel Torres 1
Recommended Posts