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.

related entries / dynamic / display

December 17, 2010 2:20pm

Subscribe [5]
  • #16 / Dec 20, 2010 10:01am

    Eastwood Design

    605 posts

    Trying to get my head around the embeded templates

    On my detail page showing the one product I am trying to get the artist’s name who is being displayed added to the embed variable

    {embed="site/related_products" artist="{exp:weblog:entries orderby="date" sort="asc" limit="1" weblog="Products" dynamic="on" disable="member_data|trackbacks"}
        {related_entries id="product_artist"}{title}{/related_entries}{/exp:weblog:entries}
        "}

    so if on this page the artist represented is John Smith I want the embed to be

    {embed="site/header" artist="John Doe"}

    and then in my embed template I have

    <div id="productdetailthumbs">
    {exp:weblog:entries orderby="date" sort="desc" limit="99" weblog="artists" dynamic="off" category="5" disable="member_data|trackbacks"}
                <!--START PRODUCT-->
    {if title == {embed:artist} }
    {reverse_related_entries sort="desc" orderby="date" weblog="Products"}
    <a href="{title_permalink={my_template_group}/fine_art_detail}" title="{title}">{product_image}
         {/reverse_related_entries} 
         {/if}
    </h2>
                  <!--END PRODUCT-->
                {/exp:weblog:entries}  
            
        </div>

    USing the code above I am getting nothing

  • #17 / Dec 21, 2010 2:10am

    John Henry Donovan

    12339 posts

    Eastwood Design,

    Something like this will work for you. I just simplified the mark-up so you can change that back. You can see I am passing the url_title here rather than using a conditional in the embed.

    On your product page use something like this

    {exp:weblog:entries orderby="date" sort="asc" limit="1" weblog="Products" dynamic="on" disable="member_data|trackbacks"}
    {title}
        {related_entries id="product_artist"}
    {embed="site/artist" artist="{url_title}"}
    {/related_entries}
    {/exp:weblog:entries}

    Then in the embed use this

    {exp:weblog:entries orderby="date" sort="desc"  weblog="artists" dynamic="off" url_title="{embed:artist}"}
    
    {reverse_related_entries sort="desc" orderby="date" weblog="Products"}
    {title}
    
     {/reverse_related_entries} 
    
     {/exp:weblog:entries}

    Let us know if that works

  • #18 / Dec 21, 2010 9:13am

    Eastwood Design

    605 posts

    Eastwood Design,

    Something like this will work for you. I just simplified the mark-up so you can change that back. You can see I am passing the url_title here rather than using a conditional in the embed.

    On your product page use something like this

    {exp:weblog:entries orderby="date" sort="asc" limit="1" weblog="Products" dynamic="on" disable="member_data|trackbacks"}
    {title}
        {related_entries id="product_artist"}
    {embed="site/artist" artist="{url_title}"}
    {/related_entries}
    {/exp:weblog:entries}

    Then in the embed use this

    {exp:weblog:entries orderby="date" sort="desc"  weblog="artists" dynamic="off" url_title="{embed:artist}"}
    
    {reverse_related_entries sort="desc" orderby="date" weblog="Products"}
    {title}
    
     {/reverse_related_entries} 
    
     {/exp:weblog:entries}

    Let us know if that works

    Wow !! amazing work.  thanks folks this indeed works!!!  You guys never cease to amaze me

  • #19 / Dec 21, 2010 5:53pm

    Ingmar

    29245 posts

    Very glad to see that helped. Please post again in case there’s anything else.

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

ExpressionEngine News!

#eecms, #events, #releases