Problems, need help? Have a tip or advice? Post it here.
12 posts Page 1 of 2
Website: http://dawn-creative.com/svtap/blog.php

I've racked my brain and cannot figure this one out. Recent Post, Archives and Categories are not showing under their specified section. I'm not sure if something is wrong with the code here or else where. Please see below and advise:

Code: Select all
<cms:if k_is_page >
       <div class="sidebar-section">
        <cms:if k_is_page >
          <h2>Recent Posts</h2>
            <ul>
               <cms:pages masterpage='blog.php' limit='4'>
               <li><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></li>
                </cms:pages>
              </ul>
        </cms:if>
        </div>
</cms:if>
       
        <div class="sidebar-section">
           <h2>Archives</h2>

               <cms:archives masterpage='blog.php' >
            <ul>               
               <li><a href="<cms:show k_archive_link />"><cms:date k_archive_date format='F Y' /></a></li>
            </ul>
               </cms:archives>

        </div>
       
        <div class="sidebar-section">
          <h2>Catagories</h2>
            <ul>
                <cms:folders masterpage='blog.php' >
                <li><a href="<cms:show k_folder_link />"><cms:show k_folder_title /></a></li>
                </cms:folders>
            </ul>
        </div>


Thank yoou
Hi,

Could you post in the entire blog.php template please?
Also if the sidebar is a snippet, please post in the entire content of the snippet.

Thanks
I've posted everything in the blog_sidebar section. Here is the blog.php:

Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Blog' clonable='1' commentable='1'>
   <cms:editable name='blog_content' type='richtext' />
   
    <cms:editable name='blog_image'
       crop='1'
        width='450'
        height='150'
        type='image'
   />
   
    <cms:folder name="svtap" title="SV Trails & Pathways" />
    <cms:folder name="trails" title="Trails" />
    <cms:folder name="events" title="Events" />

</cms:template>

<cms:if k_is_page >

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Star Valley Trails and Pathways | Your trails destination</title>

<link rel="stylesheet" type="text/css" href="style/style.css" />

</head>

<body>

<div id="scroll">

   <div id="header"> <a href="/"><img src="images/svtap_logo.png" width="162" height="116" alt="star valley trails and pathways logo"/></a>
   
       <div id="nav">
           <?php include("Library/nav.php"); ?>
        </div>

  </div>
 
  <div id="content-container">
 
     <div id="main-content">
   
    <!--BLOG POST-->

           <!--Title-->
            <h1><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h1>
            <!--Post Data-->
            <p><cms:if k_page_foldertitle >
                <cms:set my_category=k_page_foldertitle />
            <cms:else />
                <cms:set my_category='Uncategorised' />
            </cms:if> <cms:show my_category /> &bull; <cms:date k_page_date format='M jS, Y' /> &bull; Comments: <cms:show k_comments_count /></p>
            <!--Post Image-->
            <img class="thumb" src="<cms:show blog_image />" alt=""/>
            <!--Post Content-->
            <p><cms:show blog_content /></p>


    </div>
   
    <!--SIDEBAR-->
    <div id="sidebar">
          <cms:php> include 'blog_sidebar.html'; </cms:php>
        <div style="clear:both"></div>
    </div>
   
    <div style="clear:both"></div>
  </div>
 
<div style="clear:both"></div>

</div>

<div id="footer"></div>

</body>
</html>

<cms:else />
   <cms:php> include 'blog_list.php'; </cms:php>
</cms:if>

<?php COUCH::invoke(); ?>
Hi,

Instead of
Code: Select all
<cms:php> include 'blog_sidebar.html'; </cms:php>

you need to use
Code: Select all
<cms:embed 'blog_sidebar.html' />

Similarly instead of
Code: Select all
<cms:else />
   <cms:php> include 'blog_list.php'; </cms:php>
</cms:if>

this is what should be used
Code: Select all
<cms:else />
   <cms:embed 'blog_list.php' />
</cms:if>

I notice that the second snippet above has an extension of php (blog_list.php). If there is any PHP code within that embedded snippet, you should use the <cms:php>..</cms:php> there.

Please let us know if this helped.
As an addendum to my reply above -
The embedded templates (e.g. the 'blog_list.php' in this case) do not need the <?php require_once( 'couch/cms.php' ); ?> and <?php COUCH::invoke(); ?>.
These two lines are mandatory only for the main templates (blog.php in this case).

So if you have placed them in the embedded templates, please remove them too.
Thanks
I've applied the suggested changes and now all I have is a blank blog.php. That's what was happening before so I switched the the cms:php include method and it seemed to work.

Any other suggestions?

Thanks for all your help!
May I take a look at the 'blog_list.php' too? Kindly post in its complete content.
Thanks.
Certainly! Here it is:

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Star Valley Trails and Pathways | Your trails destination</title>

<link rel="stylesheet" type="text/css" href="style/style.css" />

</head>

<body>

<div id="scroll">

   <div id="header"> <a href="/"><img src="images/svtap_logo.png" width="162" height="116" alt="star valley trails and pathways logo"/></a>
   
       <div id="nav">
           <?php include("Library/nav.php"); ?>
        </div>

  </div>
 
  <div id="content-container">
 
     <div id="main-content">
       
       <cms:pages masterpage='blog.php'
           folder=k_folder_name
            start_on=k_archive_date
            stop_before=k_next_archive_date
            paginate='1'
            limit='3'
            >
                <div id="blog-section">
                <!--Post Image-->
                <p style="margin-bottom: 15px;"><img class="thumb" src="<cms:show blog_image />"></p>
                <!--Title-->
                <h1><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h1>
                <!--Post Data-->
                <p><cms:if k_page_foldertitle >
                    <cms:set my_category=k_page_foldertitle />
                <cms:else />
                    <cms:set my_category='Uncategorised' />
                </cms:if> <cms:show my_category /> &bull; <cms:date k_page_date format='M jS, Y' /> &bull; Comments: <cms:show k_comments_count /></p>
               
                <!--Post Content-->
                <cms:excerptHTML count='30' ignore='img'><p><cms:show blog_content /></cms:excerptHTML><a href="<cms:show k_page_link />"> Read more.</a></p>
                <!--Read More-->
                </div>
       
        <!--Blog Navigation-->
        <cms:if k_paginated_bottom >
            <p>
            <cms:if k_paginate_link_prev >
            <a href="<cms:show k_paginate_link_prev />" class="left">&lt; Previous Posts </a>
            </cms:if>
            <cms:if k_paginate_link_next >
            <a href="<cms:show k_paginate_link_next />" class="right"> Next Posts ></a>
            </cms:if>
            </p>
        </cms:if>
       
       
        </cms:pages >

    </div>
   
    <div id="sidebar">
          <cms:php> include 'blog_sidebar.html'; </cms:php>
        <div style="clear:both"></div>
    </div>
   
    <div style="clear:both"></div>
  </div>
 
<div style="clear:both"></div>

</div>

<div id="footer"></div>

</body>
</html>
I can see a couple of things that are not right, however none of them should result in the blank screen you reported.
Would it be possible for you to grant me temporary FTP access to your site? If so please PM me the FTP credentials (and also Couch's superadmin name/password).

It is well past quitting time here so I'll have to leave but I'll definitely look into this problem when I come back.
Thanks.
Hi,

Thanks for entrusting me with the credentials.
I have made a few changes to your site. Can you please confirm if everything is as you desired?
12 posts Page 1 of 2
cron