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.

Linking to categories in a template that displays entries from multiple weblogs (with different URLs)?

August 07, 2007 4:41am

Subscribe [2]
  • #1 / Aug 07, 2007 4:41am

    Andru Edwards

    331 posts

    Alright, I have a template that displays entries from multiple weblogs, each of which has a unique URL.

    I got the permalinks working very easily by using the comment_url_title_auto_path. What is cool about that is that it links the permalinks to the correct URLs, even though they are different (one weblog’s permalinks go to http://www.gearlive.com/news/article/url_title, another to unboxing.gearlive.com/unbox/article/url_title, and the last to games.gearlive.com/playfeed/article/url_title). The comment_url_title_auto_path was a Godsend in this respect.

    The difficulty I am having right now is linking to the categories of these different weblog entries. All the categories point to the same subdomains listed above for the respective weblogs, but there doesn’t seem to be the category equivalent of comment_url_title_auto_path. In the meantime, I have this, which I know is wrong (it only works right for the http://www.gearlive.com categories):

    <div class="subtitle">Related: {categories backspace="7"} <a href="http://{path={template_group_name}/index}">{category_name}</a>, {/categories}</div>

    Is there a way to get category links to automatically go where they should? If not, is there different coding I can use to solve this issue? 😊

  • #2 / Aug 07, 2007 4:50am

    Andru Edwards

    331 posts

    Just playing with how this might work, I tried this, but it ended up not displaying categories for any of the entries:

    Related: {if weblog == "weblog1"}{categories backspace="7"} <a href="http://{path={template_group_name}/index}">{category_name}</a>, {/categories}{if:elseif weblog == "playfeed"}{categories backspace="7"} <a href="http://{path=playfeed/index}">{category_name}</a>, {/categories}{if:elseif weblog == "unboxing"}{categories backspace="7"} <a href="http://{path=unbox/index}">{category_name}</a>, {/categories}{/if}

    Basically, I was trying to get it to style the category URL correctly based on which weblog the entry was coming from…to no avail…

  • #3 / Aug 07, 2007 4:52am

    Andru Edwards

    331 posts

    Ah. Of course - it’s because {if weblog ==} isn’t a valid parameter…duh. So back to square one, needing some help 😊

  • #4 / Aug 07, 2007 7:39am

    Sue Crocker

    26054 posts

    If weblog_id = ‘1’ might help. 😊

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

ExpressionEngine News!

#eecms, #events, #releases