Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display portlets on search page in plone?

How can I add portlets to a plone search or search results page? Using @@manage-portlets doesn't work (www.mysite.com/search/@@manage-portlets), I get an empty search result. I'd like to display the portlets of the root folder also on that pages, in my case the search column uses the whole page width.

I'm using plone 4.0.1.

like image 473
Boernie Avatar asked Nov 21 '25 22:11

Boernie


1 Answers

Search results template has left and right portlet columns disabled (hidden): http://dev.plone.org/plone/browser/Plone/tags/4.0.1/Products/CMFPlone/skins/plone_forms/search.pt#L19

If you want to display portlets there you should customize or override your search.pt template by removing the corresopnding line:

disable_column_one python:request.set('disable_plone.leftcolumn',1);
disable_column_two python:request.set('disable_plone.rightcolumn',1);

Anyway this will not let you set specific portlets for search results, as it's just a template opened in the Plone site root context. So you'll see Plone site root portlets.

The only way I think you could achieve that is:

  1. Create a new special folder for search results (i.e. search-results).
  2. Set your desired portlets in the new folder.
  3. Set search as default page for that folder.
  4. Modify search viewlet to redirect not to /search but to /search-results.
  5. Modify search_form template (adavnced search) to redirect not to /search but to /search-results.

I did it once in a Plone 3 site and it worked. Although it wasn't to display special portlets.

like image 64
marcosfromero Avatar answered Nov 23 '25 14:11

marcosfromero



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!