All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Search result url paths incorrect due to Structure plugin setup

Natacha 2 Aug 2012 01:04 problem, active

Hello

I am using Structure and have a channel/template called staticpage that I use for generic info pages.

My problem is that the search result urls output the url_title value for the page, but always at the root level - ie. the page hierarchy saved within structure is not used

I'm not able to change the Channel url (which is currently set to the root) since a staticpage channel item could live at any folder level.

The rest of my search results are AOK, it's only these generic page items that cannot have their path predetermined within the channel entry, but is set up within the Structure plugin.

Do you have any ideas on how I can get around this?

Many thanks,
Natacha

Replies

  1. Low 2 Aug 2012 06:34

    Well, you could check if an entry has a page URI assigned to it and then use that instead of the url you're using now. Just use a conditional. Something like

    {if page_url != ''} 
    {page_url}
    {if:else}
    {comment_url_title_auto_path}
    {/if}