Display portlets on search page in plone?
How can I add portlets to a plone search or search results page? Using @@manage-port开发者_如何学Pythonlets 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.
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:
- Create a new special folder for search results (i.e.
search-results
). - Set your desired portlets in the new folder.
- Set
search
as default page for that folder. - Modify search viewlet to redirect not to
/search
but to/search-results
. - 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.
精彩评论