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.

cant figure out yet how GRID actually works, help please

August 29, 2013 6:52am

Subscribe [3]
  • #1 / Aug 29, 2013 6:52am

    Riverboy

    2993 posts

    Hi,

    Im trying to understand how the new GRID field actually works.

    If i have 2 rows added, that both has one image-file, how the next photo-variable actually has to be used?

    this is just basic test i try to do, since dont yet understand the idea how it works.
    So i have this in my template, can someone tell me, that how i can show the next row in the entry i have?

    {exp:channel:entries channel="photo_gallery" orderby="date" limit="1" disable="trackbacks"}
    
     <div class="blogPost">
    
      <h5><span class="lft"></span><span class="mid">{entry_date format="%d.%m.%Y"}</span><span class="rt"></span></h5>
    
    <h2>{title}</h2>
    
    <p>{gallery limit="1"}<br />
      <ul class="thumbnails"><br />
       <li><br />
        <a href="#" class="thumbnail corner">_     <span class="topCorner"></span>_     {gallery:image}_     <span class="bottomCorner"></span>_    </a></p>
    
    <p>{gallery:kuvateksti}<br />
       </li><br />
      </ul><br />
    {gallery:next_row}<br />
        <a href="http://What-has-to-be-put-here???">Next photo</a><br />
    {/gallery:next_row}</p>
    
    <p>{/gallery}</p>
    
    <p>  </p>
    
    <p> </div></p>
    
    <p>{/exp:channel:entries}

    I bet it is very easy but just dont find my brains working and hoping that someone gives out the idea how, thanks

  • #2 / Sep 18, 2013 4:31pm

    atle

    29 posts

    Hi Riverboy, have you ever tried PixelandTonic’s Matrix fieldtype? The Grid fieldtype seems to work in the same way. If you wanted only to show one image at a time, and have the next load on a new page you should go with entries instead of rows in a grid (each photo in it’s own entry). If you want to show one image at a time, then click a link/arrow to reveal the next we’re talking about some sort of slideshow, no? That’s one of the most common uses I have for Matrix/Grid.

    The Grid fieldtype is for entry-data where you don’t know how many items you want from entry to entry. In one entry you might want to add four different contact-persons, in another only two. the Grid is a great way to do this. Or you want a slideshow at the top of your page, sometimes 4 images with captions, other times only 2.

  • #3 / Sep 19, 2013 11:09pm

    Jérôme Coupé

    122 posts

    You can actually paginate the rows in a grid. Have a look at this article on EllisLab’s blog

    HTH,

    Jérôme

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

ExpressionEngine News!

#eecms, #events, #releases