Liferay 6.2 Search result on separate page

与世无争的帅哥 提交于 2019-12-11 07:28:06

问题


Is it possible to redirect search-Result (portlet: $theme.journalContentSearch() ) to my "http://localhost/search" page?

I need this, because on home-page I don't have any portlets-placeholder, and after submit search-form, I see nothing. If I use this function on other page, it work fine, but stay in same page where I do form-submit, e.g. "/contact?****blablabla****"

/* new */
long searchPlid = plid;
System.out.println(TAG + "plid: " + plid);
//My Hidden search page
Layout searchPage = LayoutLocalServiceUtil.fetchLayoutByFriendlyURL(group.getGroupId(), false, "/search");
if (null != searchPage) {
    searchPlid = searchPage.getPlid();    
    System.out.println(TAG + "searchPlid. " + searchPlid);
}
/* /new */


if (portletResponse != null) {
    LiferayPortletResponse liferayPortletResponse = (LiferayPortletResponse)portletResponse;
    //portletURL = liferayPortletResponse.createLiferayPortletURL(PortletKeys.SEARCH, PortletRequest.RENDER_PHASE);
    portletURL = liferayPortletResponse.createLiferayPortletURL(searchPlid, PortletKeys.SEARCH, PortletRequest.RENDER_PHASE);
}
else {
    //portletURL = new PortletURLImpl(request, PortletKeys.SEARCH, plid, PortletRequest.RENDER_PHASE);
    portletURL = new PortletURLImpl(request, PortletKeys.SEARCH, searchPlid, PortletRequest.RENDER_PHASE);
}  

this doesn't work, because I stay in same page after submit form :(

来源:https://stackoverflow.com/questions/28745208/liferay-6-2-search-result-on-separate-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!