Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Search problem... why the pages that are not shown in the menu can't be searched? and issues about the paging for search results...

hi all, when you publish a page, in the Advanced Information, there is a checkbox of "Display page in menus", if you uncheck this, which means the page will not be shown in the menu, BUT, then this page will not be searched when you using SearchDataSource. another problem is i use a pagelist to receive and show the result, but the paging function doesn't work, the page link can be shown but can't direct you to other pages. the code is belowing...

thank you in advance.
Dec 20, 2007 10:06
the first problem has been solved when I add the EnableVisibleInMenu="false" property in the SearchDataSource. now the result paging issue left, thank you.
Dec 20, 2007 10:26
I got the paging to work by making some small adjustments to the default searchpage code. In the aspx page, i replaced the default asp:repeater with: <?xml:namespace prefix = episerver/><episerver:pagelist id=searchList runat="server" visible="false" pagesperpagingitem="<%# ItemsPrPage %>" paging="true" pagelinkproperty="SearchPage"><HEADERTEMPLATE> <H2><?xml:namespace prefix = asp/><asp:literal id=Literal1 runat="server" text="<%$ Resources: EPiServer, search.searchresult %>"></asp:literal></H2> <OL><BR></OL></HEADERTEMPLATE><ITEMTEMPLATE> <LI class=searchResult><A class=linkmarker href="<%#EPiServer.UriSupport.AddLanguageSelection((string)DataBinder.Eval(Container.DataItem, " languagebranch=")) %>" linkurl="), (string)DataBinder.Eval(Container.DataItem, "><%# DataBinder.Eval(Container.DataItem, "PageName")%></A> <P><%# GetPreviewText(Container.DataItem) %> </P><I><SPAN class=dateTime id=Span1 runat="server"><%# DataBinder.Eval(Container.DataItem, "Changed", "{0:g}")%> </SPAN></I></LI></ITEMTEMPLATE><FOOTERTEMPLATE></FOOTERTEMPLATE></episerver:pagelist></CODE>And in the codebhind file, in the protected override void OnLoad(....) i added the following code at the end: <CODE>searchList.DataSource = SearchDataSource.Select(DataSourceSelectArguments.Empty); searchList.DataBind(); And I replaced all references to SearchResult with my searchList -- Lars Øyvind Bodahl
Dec 21, 2007 10:24
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.