Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
I am create photo gallery by using folders, here is my code:
Code: Select all

<?php require_once( '../couch/cms.php' ); ?>
<cms:template title='Gallery' clonable='1' dynamic_folders='1' gallery='1'>

  <cms:editable
      name="gg_image"
      label="Image"
      desc="Upload your main image here"
      width='480'
      show_preview='1'
      preview_height='200'
      type="image"
   />
   
   <cms:editable
    name        = 'gg_thumb'
    assoc_field = 'gg_image'
    label       = 'CMS Thumbnail Image'
    desc        = 'Only used within the admin panel'
    width       = '115'
    height      = '115'
    enforce_max = '1'
    type        = 'thumbnail'
   />
   
    <cms:editable
    name        = 'grid_thumb'
    assoc_field = 'gg_image'
    label       = 'Grid Thumbnail Image'
    desc        = 'Used on the front end'
    width       = '480'
    height      = '302'
    crop        = '1'
    type        = 'thumbnail'
/>

</cms:template>

<cms:if k_is_page >

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
   
  </head>
 
 

<body>

                    <cms:folders>
                       <ul>
                           
                        <li><a href="<cms:show k_folder_link />"><cms:show k_folder_title /></a></li>

                           
                        </ul>
                    </cms:folders>   
                 </div>
                 
                 <div class="productwrap">
                 <div class="products">
                   <ul>
                   
                    <cms:pages folder=k_folder_name limit='9' paginate='1' >
                    <li><a class="titan-lb" href="#inline<cms:show k_count />" data-titan-group="gallery-misc" title="<cms:show k_page_title />"><img src="<cms:show grid_thumb />" /><br><cms:show k_page_title /></a></li>
                    <div id="inline<cms:show k_count />" class="pop-up" style="display:none;">
               <div class="pop-up-image"><img src="<cms:show gg_image />"></div>
               <div class="pop-up-description">
                       
                    <ul>
                          <cms:show main_content3 />
                        </ul>
                         
                 </div>
               </div>
                   
                    <cms:paginator />
                   
                    </cms:pages>
                   
                   
                   
                   
                   
                    </ul>
</div>
</div>

</body>
</html>

<cms:else />
   <cms:embed 'products-bedroom.html' />
</cms:if>

<?php COUCH::invoke(); ?>



This is my product.php page, I put the whole CMS code in one page. Let say I have menu, Bedroom, Dining Set and etc, I am managed to make the navigation/menu point to the right photo gallery folder.

The page is cloanable, the URL links look like: .../products.php?f=1, ../products.php?f=2 and so on. My problem is how can I make the the product.php point to the specific folder directly such as bedroom folder?

And I put whole code within one page, is that going to cause any problem?

Is this code correct:
Code: Select all
<cms:pages folder=k_folder_name limit='9' paginate='1' >
                    <li><a class="titan-lb" href="#inline<cms:show k_count />" data-titan-group="gallery-misc" title="<cms:show k_page_title />"><img src="<cms:show grid_thumb />" /><br><cms:show k_page_title /></a></li>
                    <div id="inline<cms:show k_count />" class="pop-up" style="display:none;">
               <div class="pop-up-image"><img src="<cms:show gg_image />"></div>
               <div class="pop-up-description">
                       
                    <ul>
                          <cms:show main_content3 />
                        </ul>
                         
                 </div>
               </div>
                   
                    <cms:paginator />
                   
                    </cms:pages>


I am now getting this result, It will auto generate a page for a product. Is this the correct way to insert/display to the page? Should it generate a page or a item?

How can I make the current active link to be highlighted?
the URL links look like: .../products.php?f=1, ../products.php?f=2 and so on. My problem is how can I make the the product.php point to the specific folder directly such as bedroom folder?
The URLs you mentioned *are* pointing to specific folders. When the template is accessed via any of these, it'll load in 'folder-view'.
You should then use cms:pages loop to list pages of that particular folder.

From your code I can see that you are indeed using cms:pages with 'folder=k_folder_name' to list pages within the folder being visited. This is the correct way. *However* the problem is that you have placed this listing code within <cms:if k_is_page > block.

'k_is_page' is the page-view which is reached when a single page is viewed. You need to do the listing, as mentioned before, in list-view or folder-view.

Please take a look at the following two links for a refresher on the views and how to handle those -
http://www.couchcms.com/docs/concepts/views.html
http://www.couchcms.com/docs/concepts/l ... pages.html

Let us know if something remains unclear.
Thanks
2 posts Page 1 of 1