Fórum

[RESOLVED] How to View Search Results Always in the Same Page

Mike Harris, modificado 12 Anos atrás.

[RESOLVED] How to View Search Results Always in the Same Page

Junior Member Postagens: 91 Data de Entrada: 28/03/11 Postagens Recentes
Hello everyone!

I'd like to know if it's possible to use the default Search Portlet but display the search results always in the same page, for example a page that would have the firendly URL "/search-page" ?

Thank you! emoticon
Mike Harris, modificado 12 Anos atrás.

RE: How to View Search Results (from Search Portlet) Always in the Same Pag

Junior Member Postagens: 91 Data de Entrada: 28/03/11 Postagens Recentes
I managed to almost do it.

I found out that you can set the page where the results will be in the Look & Feel of the search layout (with LR 6.1)

Here's what I put in my theme (inside my header) :
#######################		
			## Portlet de recherche de LR
			#set ($VOID = $velocityPortletPreferences.setValue('portlet-setup-show-borders', 'false'))
			#set ($VOID = $velocityPortletPreferences.setValue('portletSetupLinkToLayoutUuid', 'bda89b9d-430e-4e61-ac1e-8364b20dfe0c'))					
			#set ($myPortletId = "3")
			$taglibLiferay.runtime($myPortletId, '', $velocityPortletPreferences.toString())
			#set ($VOID = $velocityPortletPreferences.reset())
			#######################


The uuid is the page where the search results will be displayed.

Now the only thing that I need to figure out is to hide the search field in the header when I'm on that page (or at least not displaying the results in the header of that page but in the content)...
Mike Harris, modificado 12 Anos atrás.

RE: How to View Search Results (from Search Portlet) Always in the Same Pag

Junior Member Postagens: 91 Data de Entrada: 28/03/11 Postagens Recentes
Finally, I just added manually the form to the theme:

			<form action="/search"> 
				<input name="p_p_id" type="hidden" value="3">
				<input name="p_p_lifecycle" type="hidden" value="0">
				<input name="p_p_state" type="hidden" value="maximized">
				<input name="p_p_mode" type="hidden" value="view">
				<input name="_3_struts_action" type="hidden" value="/search/search"> 
				<input name="_3_format" type="hidden" value=""> 
				<input name="_3_groupId" type="hidden" value="0"> 
				<input name="_3_keywords" type="text" value="" size="30"> 
				<input type="submit">	
			</form>		


3 is the id of the search portlet.

Then, I'm going to hooke the search.jsp just to hide the form there. So the search box will be displayed in the header and not in the content of the result page. and the result won't be displayed in the header.