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.

nested exp:weblog tags?

November 24, 2008 7:48pm

Subscribe [3]
  • #1 / Nov 24, 2008 7:48pm

    calford

    8 posts

    hi, i am trying to do something like this

    {exp:weblog:entries weblog="homepage" orderby="entry_date" sort="desc" limit="1"}
    
    {exp:weblog:entries entry_id="{embed:id}"}
    {title}
    {/exp:weblog:entries}
    
    {/exp:weblog:entries}

    but doesnt seem to work.

    What i need is to get an ID from one article (in weblog homepage) and use it to get information from that article (the one the ID references).

    is that possible?

    thanks

  • #2 / Nov 25, 2008 3:37am

    Ingmar

    29245 posts

    No, you can’t nest tags like that (certainly not in this case). Is that all your code? {embed:} is meant to work with embedded templates, are you even using them? That said, what would be the difference to simply using

    {exp:weblog:entries weblog="homepage" orderby="entry_date" sort="desc" limit="1"}
    {title}
    {/exp:weblog:entries}

    ... ?

  • #3 / Nov 25, 2008 6:07am

    Mark Bowen

    12637 posts

    You may also want the entry_id=”“ parameter in your weblog tag too so that you can aim yourself at the correct entry?

    {exp:weblog:entries weblog="homepage" orderby="entry_date" entry_id="147" limit="1"}
    <h1>{title}</h1>
    {/exp:weblog:entries}

    Unless of course it is just the last entry entered that you need in which case you won’t need the entry_id parameter. All depends on exactly what you are trying to do though?

    Best wishes,

    Mark

  • #4 / Nov 25, 2008 5:56pm

    calford

    8 posts

    well i ended up using this

    {exp:weblog:entries weblog="homepage" orderby="entry_date" sort="desc" limit="1"}
    
    {embed ="xxx/yyy" id="{entry_id}"}
    
    {/exp:weblog:entries} 
    [code]
    
    where template yyy is
    
    [code]{exp:weblog:entries entry_id="{embed:id}"}
    {title}
    {/exp:weblog:entries}

    and it is working fine now.

    thanks

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

ExpressionEngine News!

#eecms, #events, #releases