Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I have a page that is spitting out different locations of the business. What I am trying to accomplish is to display the folder title for the heading and then display all of the locations that are in that folder underneath it. Then when I add another folder, I need it to create a new section title and then display the appropriate locations underneath. What happens is that the folder title is repeated after every location I add. What is the best way to accomplish this? Code below:

Code: Select all
<section id="content" class="fullwidth">
            <cms:pages masterpage='locations.php' folder=k_folder_title>
               <div class="row">
                  <div class="menu-content">
                     <div class="menu-list">
                        <div class="menu-title cute-12-tablet text-center">
                           <h2><cms:folders><cms:show k_folder_title /></cms:folders></h2>
                        </div>
                     </div>
                  </div>
               </div>
               <div class="gap-20"></div>
               <div class="single-location row">
                  <div class="cute-4-tablet">
                     <h2><cms:show loc_title /></h2>
                     <p class="address"><cms:show loc_street /><br /><cms:show loc_cs /></p>
                     <p><a href="<cms:show loc_dir />" target="_blank">Get Directions</a></p>
                     <div class="gap-20"></div>
                     <p><span><i class="fa fa-phone-square"></i></span> <cms:show loc_phone /></p>
                     <p><span><i class="fa fa-envelope-o"></i></span> <a href="mailto:<cms:show loc_email />"><cms:show loc_email /></a></p>
                  </div>
                  <div class="cute-4-tablet">
                     <p><strong>Manager:</strong> <cms:show loc_manager /></p>
                     <div class="gap-20"></div>
                     <p><cms:show loc_mf /></p>
                     <p><cms:show loc_ss /></p>
                  </div>
                  <div class="cute-4-tablet">
                     <iframe src="<cms:show loc_map />" width="100%" height="265" frameborder="0" style="border:0"></iframe>
                  </div>
               </div>
            </cms:pages>
         </section>
I think you can easily do that by listing the folders first. Then as you go through a folder, list the pages within it e.g. as follows -
Code: Select all
<cms:folders>

    <h2><cms:show k_folder_title /></h2>   
   
    <cms:pages masterpage='locations.php' folder=k_folder_title>
        ... list pages within this folder ...
    </cms:pages>

</cms:folders>

Does this help?
Worked great! Thanks KK
3 posts Page 1 of 1