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.

Entries duplicated multiple times?

June 22, 2010 1:13pm

Subscribe [2]
  • #1 / Jun 22, 2010 1:13pm

    jbriggs

    38 posts

    I have a simple weblog:entries tag to retrieve news items as follows:

    {exp:weblog:entries weblog="news" category="{segment_2_category_id}" disable="member_data|pagination|trackbacks" dynamic="off"}           
        {categories}
             <div class="news"><a href="http://{url_title_path=news}">{title}</a></div>
        {/categories}
    {/exp:weblog:entries}

    The problem is that if one of the News entries belongs to 3 different categories, it will get displayed 3 times.  Why is this happening if I’m explicitly telling the entry tag to only pull from the defined category, (ie category=”{segment_2_category_id}”)?

  • #2 / Jun 22, 2010 2:50pm

    JArment

    131 posts

    Try removing the {categories} and {/categories} tag. Does that work?

  • #3 / Jun 22, 2010 3:43pm

    jbriggs

    38 posts

    That does seem to fix it, thanks!  Can you explain why though?

  • #4 / Jun 22, 2010 5:19pm

    JArment

    131 posts

    Your exp:weblog:entries tag (with it’s parameters pull your one entry you wanted. But when you used the {categories} variable pair. EE ran a loop of each category for the entry you had queried. Since there were three categories, you saw a link three different times.

    Does that make sense?

  • #5 / Jun 22, 2010 5:21pm

    jbriggs

    38 posts

    That does make sense…thanks for the explanation!

  • #6 / Jun 22, 2010 5:25pm

    JArment

    131 posts

    Glad I could help. Don’t hesitate to come to the community for any other questions. They’re great when it comes to helping people.

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

ExpressionEngine News!

#eecms, #events, #releases