ASPX templates
Version 3.x > ASPX templates > Problem with search results when using document types in pages View modes: 
User avatar
Member
Member
elp-gmx - 11/17/2008 3:06:39 AM
   
Problem with search results when using document types in pages
hi there,

i have to following problems:
i am using the kentico built in site search, which is working without problems. But regarding the result list, i have problem with the displayed URLs to the pages. I am using pages with multiple documents inside one page. These documents are mostly based on custom document type (for 2 col layout) and the content is found. the problem is, that when the search finds one of the documents inside such a page, it displays the URL to the document type and not the URL of the parent page, of which the document is part of.

I tried to use "custom document path" to enter the URL of the parent path, but it only accepts unique strings, so i cannot use the same URL for multiple documents.

Please help!

elmar

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 11/18/2008 9:11:07 AM
   
RE:Problem with search results when using document types in pages
Hi,

1.
you could for example use a redirection of children documents to the parent with this code:

<SCRIPT language="JavaScript">
<!--
window.location=parent_URL;
//-->
</SCRIPT>

You could use this code in the Header section of your template (document Properties -> Template -> Edit template properties -> Header tab).

Please note that this change of template appears on all documents which have the same template. Maybe it could be useful to create an ad-hoc template ( http://devnet.kentico.com/docs/devguide/re_using_an_ad_hoc_page_templa.htm )

2.
Or you could develop your own custom search provider. Plaese see here for more information: http://devnet.kentico.com/docs/devguide/development_of_a_custom_search.htm

3.
Another possibility is to set the visual (content) inheritance appropriately so that the child document would have a different URL from the parent but it would display the needful parts (resp. all content) from the parent so that it would no matter if the seerch results return their URL or parent's URL. It depends on how you include the documents into the parent.

If you would provide us more details about your parents and children we could help you more with the settings of the visual (content) inheritance. Meanwhile, you could see here: http://devnet.kentico.com/docs/devguide/visual_inheritance.htm for more information.

Best regards,
Helena Grulichova