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.

Channel Images, Parent Relationships and ExpressionEngine 2.7

September 27, 2013 9:03am

Subscribe [1]
  • #1 / Sep 27, 2013 9:03am

    92 West

    21 posts

    We’re currently using relationships to connect entries for a magazine and are having problems getting the channel images to be pulled in to the individual posts:
    http://www.edgemagazine.com/dev/index.php/style

    There is a Channel called “Issue” that has a title only; “Issue Name”.  This allows us to connect each article to an issue of the magazine.

    Article Information for “Style”
    Title   {title}  text input
    url Title text input
    Issue {issue}  Relationship
    Gallery {gallery}  Channel Images
    Content {content}  Wyigwam

    <br /> {exp:channel:entries channel="issue" limit="1" dynamic="no"}<br />         {parents field="issue" channel="style" limit="5"}              <br />         <!—Section Article—><br />     <div class=“section-articles-container”><br />       <div class=“section-articles”><br />         <br />     <div class=“tile first-tile” ><br />           <br />     <a href="#">_               {gallery}_     <span class="image-holder"></span>_     {/gallery} _     <h3></h3>_     <span class="excerpt">some text p</span>  _           _     <span class="overlay"></span>_     </a><br />     </div><br />     <h2 class=“section-article”>{parents:title}</h2><br />     {exp:trunchtml chars="300" inline="..."}{parents:content}{/exp:trunchtml}</p> <p>    </div><br />     </div><br />         <!—/ Section Article—><br />         {/parents}<br /> {/exp:channel:entries}  <br />

  • #2 / Oct 07, 2013 2:54pm

    92 West

    21 posts

    Special thanks to Robin of EllisLab Support for the assistance (found below).

    {exp:channel:entries channel="issue" limit="1" dynamic="no"}
            {parents field="issue" channel="health_wellness"}
              <h2 class="section-article">{parents:title}</h2>
              <div class="section-author">{parents:author}</div>
              {parents:content}
              </div>
            {/parents}
          {/exp:channel:entries}

    We still have a minor hurdle to overcome:

    ////////////////////////
    How to get information from a tag pair through the new relationship parents tag.
    ////////////////////////

    Usually when using the parents tag, you get information by doing the following:

    {parents:field_name}

    But what can you do if the field involves a tag pair?

    I’ve tried this:

    {parents:field_name}
     {content}
    {/parents:field_name}

    A more accurate example is below. The field type is a channel images field type if people are familiar with that:

    {parents:gallery}
     {image:url:small}
    {/parents:gallery}
  • #3 / Oct 07, 2013 3:16pm

    92 West

    21 posts

    We got it 😊.

    {exp:channel:entries channel="issue" limit="1" dynamic="no"}
              {parents field="issue" channel="health_wellness" limit="1"} 
      <div class="tile first-tile" >
         
      <a href="#">_                {parents:gallery}_  <span class="image-holder"></span>_                {/parents:gallery}_ _  <h3>h3</h3><p>_  <span class="excerpt">some text p</span>    _       _  <span class="overlay"></span>_  </a><br />
      </div><br />
      {/parents}<br />
              {/exp:channel:entries}

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

ExpressionEngine News!

#eecms, #events, #releases