Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
I am using the tutorials to create multiple page views using dynamic folders. I would like to query couch for the folder named teamview and then tell couch to show certain styles if the folder is not teamview and specific styles if the folder is teamview.

My code:

Code: Select all
<cms:if k_is_page >
<HTML MARK UP >
  <cms:pages folder=k_folder_name>
        <cms:if k_folder_name = 'NOT teamview' >
        <cms:embed 'normal_styles.tpl' />
   <cms:else />
      <cms:embed 'specific_styles.tpl' />
   </cms:if>     
  </cms:pages>
<HTML MARK UP >
<cms:else />
   <cms:embed 'home.tpl' />
</cms:if>


Could someone help in the correct approach to this. I have combed through the documentation and it seems like i am missing something.
Hi jephcol,
I don't understand why you are using <cms:pages> inside <cms:if k_is_page >... k_is_page means that you are now in a separate page (take a look http://www.couchcms.com/docs/concepts/views.html).
Maybe you need to detect what is the folder of current page, so use <cms:dump /> and look at "k_page_foldername" variable. You can operate it with:
Code: Select all
<cms:if k_page_foldername='teamview'>
  <cms:embed 'specific_styles.tpl' />
<cms:else />
  <cms:embed 'normal_styles.tpl' />
</cms:if>
2 posts Page 1 of 1