ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Search results for single weblog and many templates

May 22, 2008 1:44am

Subscribe [1]
  • #1 / May 22, 2008 1:44am

    mojacreative

    50 posts

    I’m sure this question has been asked and answered, but I can’t find it anywhere.

    I have a site with around 5 weblogs that all have the exact same field structure, but slightly different templates to present their content.

    I want to move all the entries into one weblog and use categories to pick which template they will appear in. Now I can do this fine, but I can’t work out how I will get the search results to return the correct template in the results URL based on the category it’s assigned to?

    In fact I’m not sure this can even be done, been scratching my head for a while on this one!

    Any ideas?

  • #2 / May 22, 2008 3:04am

    Rob Allen

    3105 posts

    If you keep 5 weblogs you should be able to do this by using some conditionals in the search page results links, something like this…

    <a href="http://{url_title_path={if">Click me</a>

    This could also be applied on a category basis…

    <a href="http://{url_title_path={if">Click me</a>
  • #3 / May 22, 2008 3:41am

    mojacreative

    50 posts

    Thanks for that, it’s given me more to think about.

    We certainly have to go to a single weblog, so the second example would be the one. Although I did some quick testing with it, and category_id does not work for me, is it even a valid variable as it’s not returning anything for me?

  • #4 / May 22, 2008 4:11am

    Rob Allen

    3105 posts

    My apologies, I missed out the {categories} variable pair. Try this…

    <a href="http://{url_title_path={categories}{if">Click me</a>

    I’m not 100% sure it will work but that’s what I’d start with anyway!

  • #5 / May 22, 2008 5:35am

    mojacreative

    50 posts

    Thanks for your help… I’m sure I will have no trouble working it out from here, will play with it a bit later. Will post the solution when I find it.

  • #6 / Aug 27, 2008 3:28pm

    454 Creative

    23 posts

    nevermind, problem resolved

  • #7 / Aug 27, 2008 4:20pm

    Lisa Wess

    20502 posts

    As a note, if you keep them in 5 weblogs, you don’t even need conditionals.  You can just use {comment_url_title_auto_path}. =)

    As another option for categories you could use a category custom field to store the name of the template, so that you needn’t any conditionals then, just call that custom field as part of your link.

  • #8 / Aug 27, 2008 4:21pm

    454 Creative

    23 posts

    Well, I didnt know that you could define the search path in the weblog admin options.

    That took care of the problem complete.

  • #9 / Aug 27, 2008 4:24pm

    Lisa Wess

    20502 posts

    Glad to hear it, neekster. =)  That will be per weblog, not per category, fyi. =)

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases