Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
The issue I'm having is that when I view a page that should contain a side list of only pages from a particular folder, I get items from other folders showing up.

I've basically set up a simple gallery for my clients.

My portfolio.php is managing 3 things

if k is home shows contact details and info on left, thumbnails of folders on right.

when they click on a folder image, they are taken to a page showing images in that folders.
(if k is folder)
thumbs on left, large image on right

when they click on a thumbnail on the left, I'm expecting them to be taken to the page where that image is displayed large - which it does, but the thumbnails on the left then show images from other folders, not just from the current folder.

Any ideas where I'm going wrong here?

Code is as follows:
Code: Select all
<cms:if k_is_home >
<section class="one">
... just basic content ...
</section>
<section class="twothree">
<h1>Artwork Galleries</h1>
<ul class="gallery-thumbs">
<cms:folders masterpage='portfolio.php'>
<li>
<a href="<cms:show k_folder_link />"><figure><figcaption><h2><cms:show k_folder_title /></h2></figcaption><img src="<cms:show k_folder_image />" width="250"/></figure></a></li>
</cms:folders>
</ul>
</section>
</cms:if>


<!-- Folder Contents page -->
<cms:if k_is_folder >
<section class="one gallery"><h1><cms:show k_folder_name /></h1>
<ul class="thumbs">   
<cms:pages masterpage='portfolio.php' folder=k_folder_name include_subfolders='1'  >
<li><a href="<cms:show k_page_link />"><img src="<cms:show image />" width="140" ></a></li>
</cms:pages> 
</ul>
</section>

<section class="twothree">
<img src="<cms:show k_folder_image />" width="630" >
</section>
</cms:if>




THIS IS THE PROBLEM CODE
I dont seem to be able to make this page display only members of its Parent Folder
<!-- Single image and thumbs  -->
<cms:if k_is_page >
<h1><cms:show k_page_title /></h1>
<section class="one gallery">

<ul class="thumbs">   
<cms:pages masterpage='portfolio.php' folder=k_folder_name include_subfolders='1'  >
<li><a href="<cms:show k_page_link />"><img src="<cms:show image />" width="140" ></a></li>
</cms:pages> 
</ul>
</section>

<section class="twothree">
<img src="<cms:show image />" width="630" >
</section>
</cms:if>
For the page view, the variable 'k_folder_name' is not available. The variable containing the folder name should be 'k_page_foldername'.

Before:
Code: Select all
<cms:pages masterpage='portfolio.php' folder=k_folder_name include_subfolders='1' >
After:
Code: Select all
<cms:pages masterpage='portfolio.php' folder=k_page_foldername include_subfolders='1' >

I think that should work. :)
You champion!
That's been winding me up for the last hour or two.

Worked perfectly, thanks!

@webecho
3 posts Page 1 of 1