Forum for discussing general topics related to Couch.
11 posts Page 1 of 2
Hi

I am stuck on the gallery.php and giving it a title, it is a clonable template

I have the following coding

Code: Select all
<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='500'
      height='500'
      show_preview='1'
      preview_height='200'
      type='image'
   />
   
   <cms:editable
      name='gg_thumb'
      label='Image Thumbnail'
      desc='Thumbnail of the main image above'
      width='115'
      height='115'
      enforce_max='1'
      assoc_field='gg_image'
      show_preview='1'
      type='thumbnail'
   /> 

   <cms:editable
      name='my_thumb_2'
      label='Image Thumbnail 2'
      desc='Second thumbnail of the main image above'
      width='100'
      height='100'
      assoc_field='gg_image'
      show_preview='1'
      type='thumbnail'
   /> 
   
   <cms:editable
      name='my_desc'
      label='Description'
      height='60'
      type='textarea'
   />
               
</cms:template>

<title><cms:show page_title/></title>

<cms:embed 'header.php' />


There is no where on the admin side of the CMS to enter the title in?
Click on any image in gallery and it will lead you to its edit page. You can add the title there (as you do for any other cloned page).
Hi

ahh ok is good to know as did not know that was there but I mean on the following url

http://giftsandtreats.co.uk/gallery.php
For inputting data pertaining to the template itself (as opposed to its cloned pages), you'll have to use the 'Global values' method as described at http://www.couchcms.com/docs/tutorials/ ... -ends.html
Sorted, thank you so much works perfect

hopefully won't need to post again, regarding the site's meta tags, is that done via globals.php or is there a tutorial on it so each page has it's own meta tags?
regarding the site's meta tags, is that done via globals.php or is there a tutorial on it so each page has it's own meta tags
If the meta values are template specific, use the global method. If they are page-specific you can simply define editable regions for the meta and then each page can have its own values.
Yeah is going to be page specific, do you have any sample coding to provide or is there a tutorial link as found one but has coding missing and caused the site to not work

needs to work as well with my header.php in the snippets folder
Sorry got it working for my home, contact and thank you page but is not working on the gallery page, I think it is cause it is a clonable template and going by this post where I got it working for the other pages, I can't add a second lot in can I for the clonable gallery page?

[url]
viewtopic.php?f=8&t=8383
[/url]

it says use the following in between the <head></head> tags if not a clonable template which the home, contact and thank you pages are not

Code: Select all
<meta name="description" content="<cms:get_custom_field 'page_desc' masterpage=k_template_name />
<meta name="keywords" content="<cms:get_custom_field 'page_keywords' masterpage=k_template_name />


use the following if is a clonable template which the gallery page is but I am using header.php embed from the snippets file so can't put two lots of meta tags in surely?

Code: Select all
<meta name="description" content="<cms:if k_is_list ><cms:get_custom_field 'page_desc' masterpage=k_template_name /><cms:else /><cms:if k_is_page ><cms:show page_desc /></cms:if><cms:if k_is_folder ><cms:show page_desc /></cms:if><cms:if k_is_archive ><cms:show page_desc /></cms:if><cms:if k_is_home ><cms:show page_title /></cms:if></cms:if>" />
    <meta name="keywords" content="<cms:if k_is_list ><cms:get_custom_field 'page_keywords' masterpage=k_template_name /><cms:else /><cms:if k_is_page ><cms:show page_keywords /></cms:if><cms:if k_is_folder ><cms:show page_keywords /></cms:if><cms:if k_is_archive ><cms:show page_desc /></cms:if><cms:if k_is_home ><cms:show page_title /></cms:if></cms:if>" />
You use exactly the same technique as defining and using other editable regions. For example, following could be one way of doing it -
Code: Select all
<cms:editable name='meta_keywords' label='Meta Keywords - 7-8 max comma separated' type='text' />
<cms:editable name='meta_description' label='Meta Description - 180 words max' type='textarea' />

And then you can use the regions defined above as follows -
Code: Select all
<meta name="keywords" content="<cms:show meta_keywords />">
<meta name="description" content="<cms:show meta_description />">

You might also find the following thread useful -
viewtopic.php?f=8&t=7361

Hope it helps.
them ways did not work for me so went back to the old way that works for all pages apart from the gallery page

In my header.php file in my snippets folder, I got the following coding

Code: Select all
<meta name="description" content="<cms:get_custom_field 'page_desc' masterpage=k_template_name />">
<meta name="keywords" content="<cms:get_custom_field 'page_keywords' masterpage=k_template_name />">


In my gallery.php file, I got

Code: Select all
<cms:pages masterpage='globals.php' >
<cms:set g_site_name=site_name 'global' />
</cms:pages>


In my globals.php file, I got

Code: Select all
<cms:editable name='page_desc' type='text' label='Page Description' group='page_section_header' maxlength="160" desc='For SEO Please keep it under 160 Characters'>Please enter a short page description here</cms:editable>

<cms:editable name='page_keywords' type='text' label='Page Keywords' desc='Seperate key words with a comma' group='page_section_header' desc='For SEO Please keep it 10 keyword Phrases Seperated by Commas'>Please, enter, keywords, here, with, commas, separating, them</cms:editable>


it is sort of working cause I can see the meta tags in the view source

but is just displaying the following

Code: Select all
<meta name="description" content="Please enter a short page description here">
<meta name="keywords" content="Please, enter, keywords, here, with, commas, separating, them">


but I changed it in the admin side of Couch in the Global Settings to the following

Page Description: test gallery description description

Page Keywords: test gallery keyword 1, test gallery keyword 1, keywords, here, with, commas, separating, them
11 posts Page 1 of 2