Forum for discussing general topics related to Couch.
7 posts Page 1 of 1
Hello,

I'm just wondering how it might be possible to show the content of special folders of the image gallery in in blog posts. I want to try this to make use of the mass upload provided in the gallery instead filling dozen repeatable regions one by one.

Here is my code:

1. Created a snippet which lists the folders of the gallery:

Code: Select all
Gallerie wählen
<cms:folders masterpage="gallery.php">
   | <cms:show k_folder_title  />
</cms:folders>


2. Created a drop down menu witch list all of these folders at the blog template:

Code: Select all
  <cms:editable 
  name="galleryname"
  label="Gallerie auswählen"
  opt_values='gallery_list.php'
  dynamic='opt_values'
  type='dropdown'
  order='3'/>


3. and now my problem - which might be easy to solve - but I'm tired and my head is empty.
What is the right syntax to output the content of the chosen folder at the blog html?

I tried like this and some other versions but no luck.


Code: Select all
<cms:set visible ="<cms:show galleryname/>" 'global' />
      <cms:if visible != 'Gallerie wählen'>
      <div  class="pic gallery">
      <cms:folders masterpage="gallery.php" folder_title="<cms:show galleryname/>">
           <div class="img"><a href="<cms:show gg_image />" title="<cms:show g_desc />" rel="lightbox[<cms:show k_folder_name/>]" ><img src="<cms:thumbnail gg_image width="219" height="154" />" title="<cms:show k_page_title />" /></a></div>
      </cms:folders>
      </div>
      </cms:if>


Thank you very much for your help!
Hi,

You were *almost* there :)

Instead of cms:folders, it is the cms:pages tag that needs to be used to list pages.
Please try using the following code -
Code: Select all
<cms:set selected_gallery ="<cms:show galleryname/>" 'global' />
<cms:if selected_gallery!='' && selected_gallery != 'Gallerie wählen'>
    <div  class="pic gallery">
    <cms:pages masterpage="gallery.php" folder=selected_gallery >
        <div class="img">
            <a href="<cms:show gg_image />" title="<cms:show g_desc />" rel="lightbox[<cms:show selected_gallery />]" >
                <img src="<cms:thumbnail gg_image width="219" height="154" />" title="<cms:show k_page_title />" />
            </a>
        </div>
    </cms:pages>
    </div>
</cms:if>

Hope this helps. Please let me know.
Thanks.
Ha, thank you very much!!! It's working very nice as usual. I tried with the pages tag too, but never thought of setting the galleryname as variable.
Hi, a bit late but today I added a second folder to the gallery page. Unfortunately at the post the full content of the gallery is shown. It does not care about the folder name (folder='selected_gallery').
I found the problem. It looks like the names given to the folders were to long. I gave a name like: Happy Birthday John - this was not working. When I renamed the folder to HBJ it's working great.
Hi cl,

Folders (like pages) have two very related attributes -
1. Title. This is the human readable name and can contain spaces, special characters etc.
e.g. 'Selected Gallery'
2. Name. This is what could be termed 'machine readable' version of the title above and is used by Couch to identify pages/folders uniquely. It has a strict set of allowable characters (no spaces).
e.g. 'selected-gallery'

Both can be prominently seen when you edit either a page or folder as the top two fields.
I suppose you were trying to use a folder's title instead of its name.
Can you please give it a go once again and verify?

Thanks.
Of course you are right, as written in my first post i listed the folder titles not the names. It's fixed now and it's working great.

Thank you!
7 posts Page 1 of 1