Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andreas Pfanner 196 posts 314 karma points
    Jan 20, 2011 @ 10:25
    Andreas Pfanner
    0

    Link search result to parent document

    Hello,

    I have the following structure

    - Content
    -- Partners (Text Page)
    ---- Technology Partners (List Page)
    ------ Company 1 (List Item)
    ------ Company 2 (List Item)
    ---- Sales Partners (List Page)
    ------ Category 1 (List Category)
    -------- Company 3 (List Item)
    ------ Category 2 (List Category)
    -------- Company 4 (List Item)

    So I have a document type "List Page", where you can either create a "List Item" or a "List Category". Below a "List Category" there can be "List Item" documents created.

    On The "List Page" I have placed a macro which just outputs all the list item childs in a specific layout. If there are categories, they group the list items in a collapsible way (accordion). 

    Problem: If I search for "Company 3", I get the result, but It is linked to /partners/sales-partners/category1/company3.aspx, which has no content (since the list item itself has no template, because list items are only displayed on list pages, and not on its own page. So I want list items to link to their parent pages of type "List Page".

    Is there a clean way to implement that (avoid changing XSLTsearch.xslt)?

  • Rasmus Berntsen 215 posts 253 karma points c-trib
    Jan 20, 2011 @ 10:36
    Rasmus Berntsen
    0

    I can't see how to fix this without changing the xslt... But the change you've to make in the XSLT is quite easy, as far as I remember. I've done it a couple of times. :)

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 20, 2011 @ 10:40
    Douglas Robar
    2

    No problem at all!

    The key is to remember that every page is responsible for its own presentation. So... give the List Item pages a template so they can render their own output. But rather than displaying just their own content as would normally be done, have the template redirect to its parent page (the list category or list page).

    This has been discussed before and you can find a forum thread about it at http://our.umbraco.org/projects/website-utilities/xsltsearch/xsltsearch-bugs/14318-Search-results-linking-to-parent-page

    Do read the whole conversation as there are some important comments along the way.

    Shout if you have any problems.

    cheers,
    doug.

  • Andreas Pfanner 196 posts 314 karma points
    Jan 20, 2011 @ 10:49
    Andreas Pfanner
    0

    Shame on me, I didn't search sufficient for existing solutions..
    I also thought about this way, but I wondered if its the best practice doing so.. Well, now I think I will get along.
    Thank you!


    Regards,
    Andreas

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 20, 2011 @ 10:55
    Douglas Robar
    0

    It's a simple idea but it isn't the most obvious for many people. No problem mentioning it again. I remember Niels telling me about the idea a couple years ago when I had a similar question :)

    Do mark the answer when you have a moment so the next person will know where to look.

    cheers,
    doug.

  • Rasmus Berntsen 215 posts 253 karma points c-trib
    Jan 20, 2011 @ 11:24
    Rasmus Berntsen
    0

    Ahhh... So easy, so obvious. Good job Douglas. :)

  • Andreas Pfanner 196 posts 314 karma points
    Jan 26, 2011 @ 16:10
    Andreas Pfanner
    0

    Hey,

    this doesn't directly concern XSLTSearch, but has to to with the content structure described here (documents which are only displayed in a parent document, without its own output page), so I append it here: We already have a workaround for XSLTSearch matches using the redirect templates (see above), but I got another issue with the "Cultiv Search Engine Sitemap" package (and potentially other packages in future). Its XSLT outputs a list of all the pages, including the "list item" and "list category" documents (which should NOT be included, since they should not be visited by search engine robots). 

    Well, it would be a possibility to check the template name and only add documents to the sitemap which are not of type "list item" or "list category", but thats kinda hack.. Is there a clean solution?
    Setting umbracoNaviHide to the list items is not possible, since these items should remain searchable.. So I am thinking about adding an additional custom True/False property to the document types to specify that they are special elements without its own content page... What do you think?



    Best Regards

Please Sign in or register to post replies

Write your reply to:

Draft