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.

simple category question

October 31, 2007 12:54am

Subscribe [1]
  • #1 / Oct 31, 2007 12:54am

    julie p

    282 posts

    hey all -

    I have a template that draws from three different weblogs, searching for the three most recent postings in a certain category.  Here’s the url setup:

    http://www.mysite.com/index.php/profile/category/cat_name/

    and the code in the template:

    {exp:weblog:entries weblog="photos|audio|videos" dynamic="on" disable="trackbacks|pagination|member_data" limit="5"}
    <div id=“profile”>
    {if weblog=="Photos"}
    {title}
    {if:elseif weblog=="Videos"}
    {title}
    {if:elseif weblog=="Audio"}
    {title}
    {/if}
    </div>
    {/exp:weblog:entries}

    basically, what is being posted is a bunch of images right now, and 5 images show up, but they are not images that are in the correct category.  Doesn’t the category get read automagically from the url?

    Thanks!

  • #2 / Oct 31, 2007 12:57am

    Lisa Wess

    20502 posts

    You’ll need the relaxed_categories parameter.

    While you’re looking that, you might look up the {comment_url_title_auto_path} variable; you can cut out all of your conditionals by using that variable.  If you decide not to go that route, you’d be much better off comparing weblog_short_name to the weblog’s short name, than going off the weblog name.

    Oh, and dynamic defaults to on, you don’t need to specify it unless you want to turn it off. =)

    Oh, lastly: profile is the template group, and category is the template name, yes? You need to include the category trigger word as well.  See this article.

  • #3 / Oct 31, 2007 12:58am

    julie p

    282 posts

    Thanks so much for the quick reply.  I’ll look into these solutions.

  • #4 / Oct 31, 2007 12:59am

    Lisa Wess

    20502 posts

    I edited my post a few times, so make sure to re-read it. =)

  • #5 / Oct 31, 2007 1:11am

    julie p

    282 posts

    thanks very much - I think we’re in business now!

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

ExpressionEngine News!

#eecms, #events, #releases