Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hi

I have a client who wants to add their own images to the gallery on the php page but not 100% sure how to integrate it in

the current code is below

Code: Select all
<div id="gallery" class="ad-gallery">
      <div class="ad-image-wrapper">
      </div>
      <div class="ad-controls">
      </div>
      <div class="ad-nav">
        <div class="ad-thumbs">
          <ul class="ad-thumb-list">
                        <li>
              <a href="images/canapes1.jpg">
                <img src="images/canapes1.jpg" width="100" height="100" title="" alt="potato rosti topped with saltbeef, mustard and gherkin" class="image0">
              </a>
            </li>
                        <li>
              <a href="images/canapes2.jpg">
                <img src="images/canapes2.jpg" width="100" height="100" title=""  alt="potato rosti topped with sundried tomato and artichoke" class="image1">
              </a>
            </li>
                        <li>
              <a href="images/canapes3.jpg">
                <img src="images/canapes3.jpg" width="100" height="100" title=""  alt="potato rosti topped with sundried tomato and artichoke" class="image2">
              </a>
            </li>
                        <li>
              <a href="images/canapes4.jpg">
                <img src="images/canapes4.jpg" width="100" height="100" title=""  alt="potato rosti topped with sundried tomato and artichoke" class="image3">
              </a>
            </li>
                        <li>
              <a href="images/canapes5.jpg">
                <img src="images/canapes5.jpg" width="100" height="100" title=""  alt="potato rosti topped with roast lamb and mint jelly" class="image4">
              </a>
            </li>
                      </ul>
        </div>
      </div>
    </div>


Thank you in advance
Hi,

Please see http://docs.couchcms.com/concepts/photo-gallery.html for details on how to create a gallery.
Once everything is setup and you can upload photos, your code can be made as follows to display those photos -
Code: Select all
<div id="gallery" class="ad-gallery">
    <div class="ad-image-wrapper">
    </div>
    <div class="ad-controls">
    </div>
   
    <div class="ad-nav">
        <div class="ad-thumbs">
        <ul class="ad-thumb-list">
            <cms:pages masterpage="gallery.php" include_subfolders='0' >
            <li>
                <a href="<cms:show gg_image />">
                    <img src="<cms:show gg_thumb />" width="100" height="100" title="<cms:show k_page_title />" alt="<cms:show k_page_title />" class="image0">
                </a>
            </li>
            </cms:pages>
        </ul>
        </div>
    </div>
</div>

I think, you'll recognize from the code above that we are following the standard pattern used by almost all Couch templates - isolate the repeating element (<LI> in this case), then wrap around it a <cms:pages> block to dynamically generate multiple instances of it.

Hope it helps.
Thank you, it has helped

Just a quick one, is it possible to have text editable by couchcms on the same page as the gallery page? so the admin user can edit text as well as the gallery images?

only ask cause above the gallery images, I have a block of text that I would like the admin user to be able to edit as well
3 posts Page 1 of 1

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests