Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi! I've designed a page to dynamically show the branches of a library system, but suddenly things are not working correctly.

First, let me post the primary code:

Code: Select all
<cms:if k_is_page >
<!DOCTYPE HTML>

<html>
   <head>
      <cms:embed 'header.html' />
   </head>

<body>
   <div class="fluid-container">
   <cms:embed 'menu.html' />
   
      <img class="center-block" style="width: 600px; height: 300px;" src="<cms:show branch_image />">
      <div class="row">
      <div class="col-md-8 col-md-offset-2"><cms:show branch_blurb /></div>
      </div>
   
</div>
   <cms:embed 'includes.html' />
</body>
</html>
<cms:else embed 'branchlist.html' />
</cms:if>


And this is the relevant code for the alternate embedded file:

Code: Select all
<!DOCTYPE HTML>
<head>
<cms:embed 'header.html' />
<body>
   <div class="container-fluid">
      <cms:embed 'menu.html' />
      <div class="row">
      <cms:repeat count='4' startcount='7'>
      
         <cms:pages masterpage='branches.php' id=k_count >
         
               <div class="col-md-3 thumbnail text-center"><a href="<cms:show k_page_link />"><img style="height: 150px;" src="<cms:show branch_image />"><div class="caption"><cms:show k_page_title /></div></div>
                     
         </cms:pages>
      </cms:repeat>
      </div>
      <div class="row">
      <cms:repeat count='4' startcount='11'>
      
         <cms:pages masterpage='branches.php' id=k_count >
         
               <div class="col-md-3 thumbnail text-center"><a href="<cms:show k_page_link />"><img style="height: 150px;" src="<cms:show branch_image />"><div class="caption"><cms:show k_page_title /></div></div>
                     
         </cms:pages>
      </cms:repeat>
      </div>
      <div class="row">
      <cms:repeat count='4' startcount='15'>
      
         <cms:pages masterpage='branches.php' id=k_count >
         
               <div class="col-md-3 thumbnail text-center"><a href="<cms:show k_page_link />"><img style="height: 150px;" src="<cms:show branch_image />"><div class="caption"><cms:show k_page_title /></div></div>
                     
         </cms:pages>
      </cms:repeat>
      </div>
   </div>   
      <cms:embed 'includes.html' />
      
   </body>


On a page url, everything displays properly. On the base domain.com/branches.php address, I get a blank page. What am I missing in here?
Hi and welcome, slink,

Please amend your current code from this (some code omitted for clarity) -
Code: Select all
<cms:if k_is_page >
    ..
<cms:else embed 'branchlist.html' />
</cms:if>

- to this -
Code: Select all
<cms:if k_is_page >
    ..
<cms:else />
    <cms:embed 'branchlist.html' />
</cms:if>

As you can see, you are not using the correct syntax for the cms:else statement.

Hope this helps.
Yes, I caught that almost immediately after hitting submit. :) Thank you!
3 posts Page 1 of 1
cron