by
KK » Mon Sep 08, 2014 3:01 am
what if index.php for example is not a clonable page? as I have coded the pages and integrated the editable couch cms tags into the php page
for example I got a page called fire protection and at the bottom of that page is to be the photo gallery and then on the next page called garage units and again at the bottom is the photo gallery with different images to the fire protection page, is that possible as at the mo is the folders on the one gallery.php template page?
Ian, since you have separate templates for each page (as opposed to a single template when dealing with cloned pages), you can designate one gallery folder for each template and explicitly state that folder's name in code - for example create a folder named 'fire' for fire protection and 'garage' for garage units template.
In fire protection template use
- Code: Select all
<cms:pages masterpage='gallery.php' folder='fire' include_subfolders='0' limit='18' paginate='1'>
.. code for diplaying images here ..
</cms:pages>
while in garage template use
- Code: Select all
<cms:pages masterpage='gallery.php' folder='garage' include_subfolders='0' limit='18' paginate='1'>
.. code for diplaying images here ..
</cms:pages>
Please notice that we are specifying the 'masterpage' parameter because we are fetching pages from a template other than the one the code is being used on (e.g. fire.php, garage.php etc.)
The bottom images under the 3 large ones is the photo gallery and when click on each one of them it enlarges, is that possible?
The gallery code that comes with the documentation is just a sample code. It uses the standard cms:pages loop to list the editable regions (images and text) with just a bit of JS thrown in to add the lightbox.
You can use the cms:pages loop as showed above and then put in your CSS/JS to create whatever kind of functionality you want. A gallery is no different from any other clonable template in Couch.
Hope this helps.