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.

Pass variables between Entries tags

March 25, 2009 12:19pm

Subscribe [2]
  • #1 / Mar 25, 2009 12:19pm

    neongray

    13 posts

    Im getting stuck passing a variable from one weblog:entries loop to another. I have a “featured” section where 2 featured items are displayed, then below it I want to show everything else EXCEPT the featured items (so the parameter of entry_id would be “not (featured#1)|(features#2)”.)

    I have been trying using assign_variable and using PHP on the input and output, and haven’t been having any luck. When I assign anything {entry_id}, it just passes “{entry_id}” when it’s outside of its native weblog:entries loop.

    I might be missing out on something simple here, any ideas?

  • #2 / Mar 25, 2009 2:46pm

    Mark Bowen

    12637 posts

    Hiya,

    Could you not just use sticky status so that the two items you want in your featured items get shown first and then the others will always follow them, that would be the easiest way wouldn’t it?

    I do know what you’re after though and if that’s no good (don’t dismiss it right away though 😉 ) I’m pretty sure I know of another way of getting what you want.

    Hope that helps a bit.

    Best wishes,

    Mark

  • #3 / Mar 25, 2009 3:03pm

    neongray

    13 posts

    Its a good thought but It wont exactly work. Its my fault for not giving enough information.

    So, when adding to this weblog, the choose “Featured 1” or “Featured 2” (its a cateogry). Then each featured area respectively shows the latest featured item in that weblog.

    Then below it, in a different layout, is a shorter list of everything, and i want it to exclude the Featured 1 and Featured 2 entries. I cant exclude the categories, because many posts may be “Featured”, but only the most recent 2 get shown.

    So I want to run my Featured 1 loop and say “remember this entry_id”. The same for Featured 2, then when I run the big list, i can just say entry_id=“not x|x”

    Hope this helps.

  • #4 / Mar 25, 2009 6:36pm

    Mark Bowen

    12637 posts

    Ah okay,

    You will need part two of my post then 😉

    Try this :

    Main Template

    {exp:weblog:entries weblog="default_site" REST OF PARAMETERS YOU NEED TO BRING BACK YOUR TWO ITEMS}
    <h2>{title}</h2>
    <p>{embed="other-entries" entry_id="{entry_id}"}<br />
    {/exp:weblog:entries}


    Embedded Template - other-entries

    {exp:weblog:entries weblog="default_site" entry_id="not {embed:entry_id}" dynamic="off"}
    <h3>{title}</h3>
    <p>{/exp:weblog:entries}

    Hope that helps a bit.

    Best wishes,

    Mark

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

ExpressionEngine News!

#eecms, #events, #releases