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.

EE 2.7 Grid issues

September 04, 2013 5:25pm

Subscribe [2]
  • #1 / Sep 04, 2013 5:25pm

    mhancock

    9 posts

    I am having issues using the new grid fieldtype introduced in 2.7

    Here is my code:

    {exp:channel:entries channel="slabs" dynamic="no" entry_id="{segment_3}"}
      <div class="grid_3 portfolio_widget">
       <a href="http://{slab_image}%22class=%22zoomoff" class="zoomoff overlay">" ]_    {if slab_sale == 'Yes'}_     <div class="flag_sale_x"></div>_    {/if}_    {if slab_new == 'Yes'}_     <div class="flag_new_x"></div>_    {/if}_    <div class="portfolio_widget_image_x">_     {slab_image:small}_    </div>_   </a>
       <div class="portfolio_image_underline"></div>
       <div class="portfolio_widget_caption"> </div>
    
      </div>
    
      {!-- loop thru all additional images --}
      {slab_grid}
      <div class="grid_3 portfolio_widget">
    
       {slab_grid:count}
       <a href="http://{slab_grid:slab_grid_image}%22class=%22zoomoff" class="zoomoff overlay">" ]__    <div class="portfolio_widget_image_x">_     {slab_grid:slab_grid_image:small}_    </div>_   </a>
       <div class="portfolio_image_underline"></div>
       <div class="portfolio_widget_caption">**{slab_grid:slab_grid_gallery}**</div>
      </div>
      {/slab_grid}
    
     {/exp:channel:entries}

    I am having trouble accessing the grid items in the bottom loop (contained in {slab_grid} {/slab_grid}.

    The {slab_grid:count} correctly returns the looping count, so I know I’m in the loop the correct number of times. I need to access the {slab_grid:slab_grid_image} and also the {slab_grid:slab_grid_gallery}.

    The “slab_grid_image” points to an uploaded file and the “slab_grid_gallery” is a drop down list so we can determine what gallery (if any) the additional image should be related too.


    Any help would be appreciated…

  • #2 / Sep 04, 2013 7:57pm

    disegno

    3 posts

    I’ve noticed this too - my solution was to rename the fields within the grid - they couldn’t contain the same field name as the parent.

    ie. slab_grid:slab_grid_gallery

    won’t work, but to fix, rename to

    ie. slab_grid:grid_gallery

    Cheers,

    Christiaan

  • #3 / Sep 05, 2013 9:01am

    mhancock

    9 posts

    Wow, worked like a charm…

    Never would have thought of that.

    Thanks, saved me a bunch of time!

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

ExpressionEngine News!

#eecms, #events, #releases