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

I am making my way through the tuts and have been enjoying CouchCMS, but have found an issue with the portfolio page or tutorial.

The code which allows you to add 3 images to a post is stumping me.

My admin screen looks exactly like the one found here http://www.couchcms.com/docs/img/121.png and see I that it displays only 1 Upload field and 1 thumb view for image 1.

I have tried multiple ways to try get it to work properly.
With the code below I can get it to upload image 2 and 3 now, but no thumb views for images 2 and 3 in the admin section.

Any help please - I will be buying a comm licence soon, as I am doing this site as a favor for a friend. You know how those go :). never do it. :) Kidding.

Once site is up, I will post a link.

Code: Select all
<cms:template title='Portfolio' clonable='1'>
   <cms:editable
       name='content'
       label='Content'
       desc='Enter description of portfolio item here'
       type='richtext' />
   
   <cms:editable name='group_img' label='Image Group' desc='Image Group' type='group' />
   <cms:editable
      name='image_1'
      label='Image 1'
      desc='Upload first image of portfolio here'
      crop='1'
      width='600'
      height='300'
      group='group_img'
      type='image'
   />   
   <cms:editable
       name='image_1_title'
       label='Image Title 1'
       desc='Upload first image of portfolio here'
       group='group_img'
       type='text'
   />
   <cms:editable
     name='thumb'
     label='Image Thumbnail'
     desc='Thumbnail of first image'
     width='223'
     height='112'
     show_preview='1'
     assoc_field='image_1'
     group='group_img'
     type='thumbnail'
   />
   
   <cms:editable
      name='image_2'
      label='Image 2'
      desc='Upload 2 image of portfolio here'
      width='600'
      height='300'
      crop='1'
      group='group_img'
      type='image'
   />
   <cms:editable
       name='image_2_title'
       label='Image Title 2'
       desc='Enter images\'s title here'
       group='group_img'
       type='text'/>

      
   <cms:editable
      name='image_3'
      label='Image 3'
      desc='Upload 3 image of portfolio here'
      width='600'
      height='300'
      crop='1'
      group='group_img'
      type='image'
   />
   <cms:editable
       name='image_3_title'
       label='Image Title 3'
       desc='Enter images\'s title here'
       group='group_img'
       type='text'/>

   <cms:folder name='cat_1' title='First category' />
   <cms:folder name='cat_2' title='Second category' />   
   <cms:folder name='cat_3' title='third category' />   
      
</cms:template>

Attachments

Hi Skully,

The reason why you are not seeing thumbnails fro the second and third image is because we have not defined any thumbnail type editable region for them!

If you look carefully at the code you posted, the thumbnail editable region has been defined for only the first image.
Code: Select all
<cms:editable
     name='thumb'
     label='Image Thumbnail'
     desc='Thumbnail of first image'
     width='223'
     height='112'
     show_preview='1'
     assoc_field='image_1'
     group='group_img'
     type='thumbnail'
   />

The reason was simply to get one thumbnail relevant to the portfolio that could be displayed on the list page.
If you wish to create thumbnails for all the three images, please go ahead and add two more editable regions - one each to the two remaining images
Code: Select all
<cms:editable
     name='thumb2'
     label='Image Thumbnail'
     desc='Thumbnail of second image'
     width='223'
     height='112'
     show_preview='1'
     assoc_field='image_2'
     group='group_img'
     type='thumbnail'
   />
<cms:editable
     name='thumb3'
     label='Image Thumbnail'
     desc='Thumbnail of third image'
     width='223'
     height='112'
     show_preview='1'
     assoc_field='image_3'
     group='group_img'
     type='thumbnail'
   />

Please notice how the thumbnails have their assoc_field set to the main image they are associated with.

Since you'll be creating the thumbnails after already having created the other regions, the new regions will physically show up after all the existing regions. If you wish to show the thumbnail immediately after its main image, you can use the order parameter of editable tags to set the display order of the regions (see http://www.couchcms.com/docs/tags-refer ... table.html).
HI KK,

Perfect - works like a charm, sorry to have missed that -I have read through the docs, and have a better understanding now.

Thanks for your help.

Skully.

The code i used was

Code: Select all
<cms:template title='Portfolio' clonable='1'>
   <cms:editable
      name='content'
      label='Content'
      desc='Enter description of portfolio item here'
      type='richtext' />
   
   <cms:editable name='group_img' label='Image Group' desc='Image Group' type='group' />
   
   <cms:editable
      name='image_1'
      label='Image 1'
      desc='Upload first image of portfolio here'
      crop='1'
      width='600'
      height='300'
      group='group_img'
      type='image' />   
      
   <cms:editable
      name='image_1_title'
      label='Image Title 1'
      desc='Upload first image of portfolio here'
      group='group_img'
      type='text' />
      
   <cms:editable
      name='thumb'
      label='Image Thumbnail'
      desc='Thumbnail of first image'
      width='223'
      height='112'
      show_preview='1'
      assoc_field='image_1'
      group='group_img'
      type='thumbnail'/>
   
   <cms:editable
      name='image_2'
      label='Image 2'
      desc='Upload 2 image of portfolio here'
      width='600'
      height='300'
      crop='1'
      group='group_img'
      type='image'/>
      
   <cms:editable
       name='image_2_title'
       label='Image Title 2'
       desc='Enter images\'s title here'
       group='group_img'
       type='text'/>   
      
   <cms:editable
      name='thumb2'
      label='Image Thumbnail'
      desc='Thumbnail of second image'
      width='223'
      height='112'
      show_preview='1'
      assoc_field='image_2'
      group='group_img'
      type='thumbnail'/>

   <cms:editable
      name='image_3'
      label='Image 3'
      desc='Upload 3 image of portfolio here'
      width='600'
      height='300'
      crop='1'
      group='group_img'
      type='image'/>
      
   <cms:editable
       name='image_3_title'
       label='Image Title 3'
       desc='Enter images\'s title here'
       group='group_img'
       type='text'/>
      
   <cms:editable
      name='thumb3'
      label='Image Thumbnail'
      desc='Thumbnail of 3 image'
      width='223'
      height='112'
      show_preview='1'
      assoc_field='image_3'
      group='group_img'
      type='thumbnail'/>

   <cms:folder name='cat_1' title='First category' />
   <cms:folder name='cat_2' title='Second category' />   
   <cms:folder name='cat_3' title='third category' />   
      
</cms:template>
3 posts Page 1 of 1

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests

cron