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.

EE2 Photo Gallary example

September 09, 2011 1:10pm

Subscribe [2]
  • #1 / Sep 09, 2011 1:10pm

    bmagic

    1 posts

    This question may be related to a http://ellislab.com/forums/viewthread/195029/ resolved thread.

    Hello,
    I am trying to make a straight forward photo group gallery. Meaning, a single channel with a category for each of the photo groups. Therefore, a published entry would simply need to be associated with the category (photo group).

    Here is the code that I have come up with - This code is supposed to present each of the categories. Each of the categories is represented by the first photo in the group.

    <table class=“phototable”>
    <tr>

    {exp:channel:categories channel="photos" style="linear"}
    {preload_replace:catadd="{category_id}”}
    {exp:channel:entries channel="photos" sort="asc" category="{embed:catadd}” limit=1}

    category={category_id}
    {if count==1}
    <td>
    _{the_photo}_


    <div [removed]>
    {category_name}
    </div>
    </td>
    {/if}
    {switch='||</tr><tr>'}
    {/exp:channel:entries}

    {/exp:channel:categories}


    </tr></table>

    F.Y.I. - The forum edited my code and removed my Anchor tag and made it URL for some reason.

    of course this isn’t behaving like I would like it to. It seems to loop through all of the photos in a category even though I have the if statement to only output on the first entry. I added the limit=1 to help also but it doesn’t work.

    Any insight? I am not opposed to doing it altogether different.

  • #2 / Sep 10, 2011 12:23am

    Dan Decker

    7338 posts

    bmagic,

    One quick note, it is helpful to use:

    [code]

    and

    </code></pre>
    Wrap any template code, html or tags in those opening and closing code tags. The forums formats that text for readability and won’t mess with your anchors.

    On you your question. You might have better success with your gallery idea if you tried using the File Manager. The docs even include a simple gallery example.

    Cheers,

  • #3 / Sep 10, 2011 2:24am

    Lisa Wess

    20502 posts

    Hi, bmagic - welcome to our community. =)

    I’m not seeing a license on your account.  We’re going to have to suspend support on this issue until we sort that out.  Can I ask you to email sales with the license number for the site you’re developing on, and we can get you full support access?

    Thanks!

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

ExpressionEngine News!

#eecms, #events, #releases