Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hello I am working with the gallery concepts. I allways want to output the main categories on top on every site of the gallery. I tried this, but the main categories are not showing on subfolders I open. How can I show all main categories on top (1st level)
Code: Select all
<div id="gallery-wrapper">
   <h1>Test-Gallery Chichi</h1>


<cms:ignore><!-- k_is_list start --></cms:ignore>
   <cms:if k_is_list >
     
<cms:ignore><!-- gallery folders output --></cms:ignore>
      <cms:set my_page="<cms:gpc 'pg' method='get' />" />
      <cms:if my_page lt '2' >
      <ul class="gallery folders">
       <li><a href="testgallery.php"><span class="title">>> show all</span></a></li>
            <cms:folders childof=k_folder_name hierarchical='1' depth='1'>
           
               <cms:set my_folder_image="" />
               <cms:if k_folder_image>
                  <cms:set my_folder_image=k_folder_image />
               <cms:else />
                  <cms:pages folder=k_folder_name include_subfolders='0' limit='1'>
                      <cms:set my_folder_image=my_thumb_2 scope='parent' />
                  </cms:pages>
               </cms:if>
               <cms:if my_folder_image=''><cms:set my_folder_image="<cms:show k_admin_link />theme/images/empty-folder.gif" /></cms:if>
               
               <li>
                  <a href="<cms:show k_folder_link />">
                     <span class="title">>> <cms:show k_folder_title /></span>
                  </a>
               </li>
            </cms:folders>
         </ul>
<cms:ignore><!-- gallery folders end --></cms:ignore>
           
      </cms:if>
<cms:ignore><!-- k_is_list end --></cms:ignore>

<cms:ignore><!-- gallery images start, include_subfolders='1' to show all images of all folders, include a counter starting with 1--></cms:ignore> 
      <ul class="gallery">
         <cms:pages folder=k_folder_name include_subfolders='1' limit='5000' paginate='0'>
            <li>
               <a href="<cms:show k_page_link />">
                 
                  <img alt="<cms:show k_page_title />" src="<cms:show my_thumb_2 />"/>
                  No.<cms:show k_count /> - <cms:show k_page_title />
                 
                 
               </a>
            </li>

         </cms:pages>
      </ul>
 
   <cms:else /><!-- k_is_page -->   
     
      <ul class="gallery folders">
      <li><a href="javascript:history.back(-1)"><span class="title"><< back</span></a></li>
      <li><a href="testgallery.php"><span class="title">>> show all</span></a></li> 
            <cms:folders childof=k_folder_name hierarchical='1' depth='1'>
           
               <cms:set my_folder_image="" />
               <cms:if k_folder_image>
                  <cms:set my_folder_image=k_folder_image />
               <cms:else />
                  <cms:pages folder=k_folder_name include_subfolders='0' limit='1'>
                      <cms:set my_folder_image=my_thumb_2 scope='parent' />
                  </cms:pages>
               </cms:if>
               <cms:if my_folder_image=''><cms:set my_folder_image="<cms:show k_admin_link />theme/images/empty-folder.gif" /></cms:if>
               
               <li>
                  <a href="<cms:show k_folder_link />">
                     <span class="title">>> <cms:show k_folder_title /></span>
                  </a>
               </li>
            </cms:folders>
         </ul>
         
         
         <div id="image_container">
         <img alt="<cms:show k_page_title />" src="<cms:show gg_image />"/><br /><h3><cms:show k_page_title /></h3>
      </div>
     
   </cms:if>

</div><!-- gallery-wrapper -->
* * * * * * I LOVE COUCH CMS - flexible and straight forward * * * * * *
I allways want to output the main categories on top on every site of the gallery.
Place the following code where you want the output to always appear (do not use any cms:if to wrap the following code) -
Code: Select all
<ul class="gallery folders"> 
    <cms:folders hierarchical='1' depth='1'>
   
       <cms:set my_folder_image="" />
       <cms:if k_folder_image>
          <cms:set my_folder_image=k_folder_image />
       <cms:else />
          <cms:pages folder=k_folder_name include_subfolders='0' limit='1'>
              <cms:set my_folder_image=my_thumb_2 scope='parent' />
          </cms:pages>
       </cms:if>
       <cms:if my_folder_image=''><cms:set my_folder_image="<cms:show k_admin_link />theme/images/empty-folder.gif" /></cms:if>
       
       <li>
          <a href="<cms:show k_folder_link />">
             <img alt="<cms:show k_folder_title />" src="<cms:show my_folder_image />"/>
             <span class="title"><cms:show k_folder_title /></span>
             <span class="count_images"><cms:show k_folder_totalpagecount /> images</span>
             <span class="count_folders"><cms:show k_folder_totalchildren /> folders</span>
          </a>
       </li>
    </cms:folders>
</ul>
Thank you for the fast solution. Works great even with folder-images. Couch is so much fun. Your support ist excellence. :D
* * * * * * I LOVE COUCH CMS - flexible and straight forward * * * * * *
3 posts Page 1 of 1