Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I have a template 'photos.php', which serves as a list view for 2 clonable Galleries, consisting simply of images and thumbnails within a grid. The galleries do not have specific pages for each image; they are just listed in the view:

Code: Select all
<?php require_once( couch/cms.php' ); ?>
<cms:template title='Photos' clonable='1' order='5'>

  <cms:editable name='gallery_image'
                label='Image'
                type='image'
                show_preview='1'
                order='1'
  />

  <cms:editable name='thumbnail_image'
                label='Thumbnail of Image'
                width='211'
                height='211'
                show_preview='1'
                assoc_field='gallery_image'
                type='thumbnail'
                order='2'
  />

  <cms:folder name="gallery1" title="First Gallery" />
  <cms:folder name="gallery2" title="Second Gallery" />

</cms:template>


And then I output the fields in the following way:

First Gallery
Code: Select all
<cms:pages masterpage='photos.php' folder='gallery1' >

            <a href="<cms:show gallery_image />" title="<cms:show k_page_title />" class="gallery-item">
              <img src="<cms:show thumbnail_image />" alt="<cms:show k_page_title />">
            </a>

            </cms:pages >


Second Gallery
Code: Select all
<cms:pages masterpage='photos.php' folder='gallery2' >

            <a href="<cms:show gallery_image />" title="<cms:show k_page_title />" class="gallery-item">
              <img src="<cms:show thumbnail_image />" alt="<cms:show k_page_title />">
            </a>

            </cms:pages >


Now this works without problems, all thumbnails are listed correctly with the corresponding images.

However, the problem is that I need to add some editable regions for the SEO of the list view 'photos.php', and not for the clonable pages (which do not exist). For my other pages I use the following editable regions at the top:

Code: Select all
<cms:editable name='seo_group' 
                label='SEO'
                type='group'
  />

  <cms:editable name='seo_title'
          label='Page Title'
          desc='Enter a page title of up to 60 characters'
          type='text'
          validator='max_len=60'
          group='seo_group'
          order='1'
  />

  <cms:editable name='seo_description'
          label='Meta Description'
          desc='Enter a page description of up to 160 characters'
          type='textarea'
          validator='max_len=160'
          height='80'
          group='seo_group'
          order='2'
  />


If I would add this to the clonable template, the SEO fields would be added to every single image entry, which is not needed nor wanted. I just want it for the list view.

How can I solve this?
Hi,

The solution is to use a global template to hold such values.
Please see http://www.couchcms.com/docs/tutorials/ ... -ends.html where this problem and its solution is discussed in detail.

Hope it helps.
Ok, I had hoped to be able to include the page-specific SEO on the same template page also for list views, as I already arranged it in this way for "non-clonable" pages. Will move all SEO fields to globals.php then.

Thanks.
3 posts Page 1 of 1