Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I am setting up a gallery page with sub-navigation by folders. I want to display the contents of the first gallery folder in the home view. So I want to identify the name of the first folder and then display its contents if k_is_home.

I have the following:
Code: Select all
             <cms:set folder_count='0' />   
               <cms:folders depth='1' orderby='weight' >           
                  <cms:incr folder_count '1' />
                     <cms:if folder_count=='1'><cms:set first_folder=k_folder_name /></cms:if>
                     <cms:show first_folder /> = first_folder
                     ... ... ...
               </cms:folders>
                  <cms:show first_folder /> = first_folder outside folders tag

The <cms:show> tags are there for testing.

The first <cms:show> within the <cms:folders> tag has the name of the first folder set.
The second <cms:show> outside the <cms:folders> tag does not.

Wondering why?
Hi,

Try setting the variable scope to 'global' like this
Code: Select all
<cms:set first_folder=k_folder_name 'global' />

Does this help?
thanks KK - it works now (I appreciate the super-speedy reply!)
3 posts Page 1 of 1