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.

Query channel field [image gallery]

August 11, 2013 12:37pm

Subscribe [1]
  • #1 / Aug 11, 2013 12:37pm

    somvannda

    37 posts

    Hi,

    I really have no idea how to query all the fields from an entry. I created a channel with more than 10 channel fields as photo field.

    I want to query every single channel fields from a channel entry, which I created to hold all the fields with photos.

    Recently, I am using a normal one like this, but I have to call it every single lines and that so worse.

    {exp:channel:entries
     title="{segment_2}"
     dynamic="yes"
     status="not Closed"
     disable="categories|member_data|pagination"
    }
      <ul class="gallery clearfix">
      <li><a href="http://{upload_photo}" rel="prettyPhoto"></a></li>
      <li><a href="http://{upload_photo_1}" rel="prettyPhoto"></a></li>
      </ul>
    {/exp:channel:entries}

    And the funniest thing is that, all the images are not shown up, I viewed the code from the browser but what I got is in this code below. It repeats two times. lol

    <ul class="gallery clearfix">
      <li><a href="http://ticambodia.org/images/photoalbum/DSC00277.JPG">" src="http://ticambodia.org/images/photoalbum/DSC00277.JPG" width="60" height="60"]</a></li>
      <li><a href="http://ticambodia.org/images/photoalbum/IMG_2077.JPG">" src="http://ticambodia.org/images/photoalbum/IMG_2077.JPG" width="60" height="60"]</a></li>
     </ul>
    
    " width=
    " width= 
    <ul class="gallery clearfix">
      <li><a href="http://">" src="" width="60" height="60"]</a></li>
      <li><a href="http://">" src="" width="60" height="60"]</a></li>
     </ul>

    I hope you can help me dealing with this, or share me a free addon of an image gallery or if it is possible, please let me know how to make one with a better solution?

    Kindly regards,

  • #2 / Aug 12, 2013 1:09pm

    Giraffentoast

    152 posts

    {exp:channel:entries title="{segment_2}"}

    won’t work. (See manual) Try this:

    {exp:channel:entries url_title="{segment_2}"}

    Also, your HTML markup has errors.
    Try this:

    {exp:channel:entries title="{segment_2}" dynamic="yes" status="not Closed" disable="categories|member_data|pagination"}
      <ul class="gallery clearfix">
      <li><a href="http://{upload_photo}" rel="prettyPhoto">{upload_photo}</a></li>
      <li><a href="http://{upload_photo_1}" rel="prettyPhoto">{upload_photo_1}</a></li>
      </ul>
    {/exp:channel:entries}

     

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

ExpressionEngine News!

#eecms, #events, #releases