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.

Creating dynamic lists with relationships

October 18, 2012 2:23pm

Subscribe [2]
  • #1 / Oct 18, 2012 2:23pm

    lxg5810

    3 posts

    First off hello everyone!

    I do have to say that I am rather new to EE so this may be a simple solution. But the best thing is to show what I am trying to do.

    I have a product page of beers and its brewers. Brewers has its own channel and so does beers(client can manage their list and brewers), I am using playa to connect the 2.

    So I am trying to create a list that has a header with the brewers name and then under that lists all its products.

    So it would look something like this

    Brewer
    Product
    product
    product

    Another Brewer
    Another Product
    Another product
    Another product

    And the list continues with all the brewers and products.

    this is my code so far

    {exp:playa:children field="brewery_winery_company"}
      <h3>{brewer_name}</h3>
    <p>   <br />
     {embed="products/product_list" prod_brewery="{brewery_winery_company:child_ids}"}</p>
    
    <p>  {/exp:playa:children}

    And in the embed code I have

    {exp:channel:entries channel="products" } 
     {product_name}
    {/exp:channel:entries}

    It lists out each category and then lists out the products within the category ( wine, beer, NA) So at least its listing the correct products, just not displaying them under the correct brewer.

    Thank you in advance!

     

  • #2 / Oct 22, 2012 6:37pm

    e-man

    1816 posts

    You have a prod_brewery embed variable which isn’t being used in your embed - could that be it?

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

ExpressionEngine News!

#eecms, #events, #releases