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.

exp:weblog:entries -- combine 2 weblogs into one list, but separate the title_permalinks

December 23, 2007 1:18pm

Subscribe [3]
  • #1 / Dec 23, 2007 1:18pm

    pottercreative

    17 posts

    I’d like to combine two weblogs in my tag like:

    {exp:weblog:entries weblog="events|special_events"}... and have the resulting list output a list <li>{title}</li>

    ‘events’ and ‘special_events’ are separate weblogs, and each will have its own template for viewing the content. I’d like the list that is output to combine the results, but the url for the link will separate each out into its own template

    I am using categories quite extensively so this could be used as a hook.

    Any ideas?

  • #2 / Dec 25, 2007 4:20pm

    Derek Jones

    7561 posts

    You could use a conditional based on which weblog the entry is in:

    {if weblog_short_name == "events"}<li><a href="http://{title_permalink={my_template_group}/foo}">{title}</a></li>{/if}
    {if weblog_short_name == "special_events"}<li><a href="http://{title_permalink={my_template_group}/bar}">{title}</a></li>{/if}

    Or you can make use of the {comment_url_title_auto_path} variables, which will pull from the path settings for each weblog.

    <li><a href="http://{comment_url_title_auto_path}">{title}</a></li>

    Either choice is perfectly fine, it just depends on whether you need/want to control this in the template, or from the weblog preference settings.

  • #3 / Dec 25, 2007 4:23pm

    Sue Crocker

    26054 posts

    Merry Christmas!

    You can certainly do this. Here’s one method:

    Set the Comment URL Title Auto Path

    for each weblog.

    NOTE: I don’t use comments on the sites I create, but I can use that setting to point to a single entry url.

    Make sense?

  • #4 / Dec 25, 2007 8:07pm

    pottercreative

    17 posts

    That’s exactly what I ended up doing. I couldn’t figure out another solution, and I came across your solution in the forums…

    Thanks!
    Ben

  • #5 / Dec 27, 2007 5:56am

    alex7

    130 posts

    Hmmm… in my case the code below doesn’t work.

    You could use a conditional based on which weblog the entry is in:

    {if weblog_short_name="events"}<li><a href="http://{title_permalink={my_template_group}/foo}">{title}</a></li>{/if}
    {if weblog_short_name ="special_events"}<li><a href="http://{title_permalink={my_template_group}/bar}">{title}</a></li>{/if}

    [...]

    Maybe typo with “=”?

    {if weblog_short_name="events"}

    I guess it should be “==”? 😜

  • #6 / Dec 27, 2007 10:21am

    Derek Jones

    7561 posts

    Yes, thanks alex7, edited.

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

ExpressionEngine News!

#eecms, #events, #releases