Forum for discussing general topics related to Couch.
9 posts Page 1 of 1
I am pulling my hair out trying to find why my blog.php template is not properly showing the contents of that file. When I change content on the blog.php file, ie: menu items, page title, h1, etc., the changes are not being reflected on the site. It's as if I'm editing the wrong file but I am editing the file that is at the location I am pointing to. I must be missing something.

I recently updated all the pages on the site except the pages in the couch directory and blog related pages. After updating them the template I set up for the blog.php page stopped rendering properly.

The site is http://dubowmediation.net/blog.php

Here is the contents of the blog.php file:
Code: Select all
<?php require_once( 'news/cms.php' ); ?>
<cms:template title='Blog' clonable='1' commentable='1'>
   <cms:editable name='blog_content' type='richtext' />
   
   <cms:editable name='blog_image'
              width='500'
              type='image'
   />
</cms:template>
<cms:if k_is_page >
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html ><!--<![endif]--><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
   
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">

   <title>Dubow Mediation - Blog</title>
   
   <link href="<cms:show k_site_link />/css/css.css" rel="stylesheet" type="text/css">
   <link rel="stylesheet" href="<cms:show k_site_link />/css/style.css" type="text/css" media="screen">
   <link rel="stylesheet" href="<cms:show k_site_link />/css/reset.css" type="text/css" media="screen">
   
   <script style="" type="text/javascript" src="../js/jquery_002.js"></script>
   
    <!-- Bootstrap -->
    <link href="<cms:show k_site_link />/css/bootstrap.css" rel="stylesheet">
   
    <script type="text/javascript">
      $( document ).ready(function() {
         
            if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
            
            
// some code..
                
                 if($( document ).width() < 800) {
                
                        jQuery('ul.nav-main li.menu-item-has-children').hover(function(){
                         
                              jQuery(this).find('div').css('height','0px');
                         
                          });
                         
                         
                         
                          jQuery('ul.nav-main li.menu-item-has-children').find('img.plus').click(function(){
                              //alert(111222);
                              
                              if(jQuery(this).parent().next('div').height() > 0){
                                 jQuery(this).parent().next('div').css('height','0px');
                              }else{
                                 jQuery(this).parent().next('div').css('height','180px');
                              }
                              
                              return false;
                         
                          });
                      
                    }
                   
            }       
                
                
      });

   </script>

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
   <script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-55519512-1', 'auto');
  ga('send', 'pageview');

</script>
   </head>
<body class="innerpages" id="blogpage">
   <div id="bg">
     <img src="../images/newblog.jpg" alt="">
   </div>
   
   
   <div class="layout-980 layout-short"  id="wrapper">
      
      
      <!-- Header -->
      <header id="header">
         <div>
            <!-- Full Header -->
            <div class="header-full">
               <div class="locked-bg"></div>
               
               <a href="../index.html" class="logo">
                  <img class="small" src="../images/logo.png" alt="">
               </a>
               
               <a href="javascript:void(0)" onClick="$('.nav-main').slideToggle('slow');" class="menutoggle">
                  Menu
               </a>

               <ul class="nav-main">
               
                  <li><a href="../about.html">about</a></li>
                  
                  <li class="menu-item-has-children">
                     <a href="../services.html">services<img class="plus" src="images/plus.png" alt=""></a>
                     <div>
                        <ul>
                           <li><a href="residential.html">Residential Real Estate</a></li>
                           <li><a href="commercial.html">Commercial Real Estate</a></li>
                           <li><a href="title.html">Title Insurance</a></li>
                           <li><a href="foreclosures.html">Foreclosures</a></li>
                           <li><a href="probate.html">Probate</a></li>
                           <li><a href="appeals.html">Appeals</a></li>
                        </ul>
                     </div>
                  </li>
                  
                  <li><a href="../testimonials.html">Testimonials</a></li>
                  <li class="active"><a href="/blog.php">Blog</a></li>
                  <li><a href="../contact.html">Contact</a></li>
                  <li class="linkedin"><a href="http://lnkd.in/bc5jEj9"><img src="../images/linkedin.png" alt=""></a></li>
                  
                  
               </ul>
            </div>
            <!-- \Full Header -->

            
         </div>
         
         
         
      </header>
      <!-- \Header -->

      
   <!-- Page Content -->
   
   <div class="cb"></div>
   
   <div class="fullwidth innerpage">
   
      <div class="innerpage_left">
      
         <h1>Blog</h1>
         
         <div class="testim"><!--Uncomment to add descriptive text"Ga. Ed maxim quatiuntorio et ant aborro<br> eostrum eost, earum etur am, voluptat dolupis<br> trundis inte nosti a doluptam"--></div>
         <div class="blog-wrapper">
         <div class="content">
            <!-- Blog Post -->
         <div class="post">
            <!-- Post Title -->
            <h3 class="title"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h3>
            <!-- Post Date - removed
            <p class="sub"><cms:date k_page_date format='F j, Y'/></p>
            <div class="hr dotted clearfix">&nbsp;</div>-->
            <!-- Post Title -->
            <img class="thumb" src="<cms:show blog_image />" alt=""/><br />
            <!-- Post Content -->
            <cms:show blog_content />
            <!-- Post Links -->
            <p class="clearfix">
               <a href="<cms:link masterpage='blog.php' />" class="left" >&lt;&lt; Back to Blog</a>
         </div>
         <div class="hr clearfix">&nbsp;</div>
         <div class="comments">
         <!-- Comment's List -->
         <h3>Comments</h3>
         <div class="hr dotted clearfix">&nbsp;</div>
         
         <cms:if k_comments_count >
         <ol class="commentlist">
            <cms:comments page_id=k_page_id order='asc' limit='5' paginate='1' >
            <li class="comment">
               <div class="gravatar">
                  <cms:gravatar email="<cms:show k_comment_author_email />" size="60" />
                  <a name="<cms:show k_comment_anchor />">
               </div>
               <div class="comment_content">
                  <div class="clearfix">
                     <cite class="author_name"><a href=""><cms:show k_comment_author /></a></cite>       
                     <div class="comment-meta commentmetadata"><cms:date k_comment_date format='F j, Y'/> at <cms:date k_comment_date format='h:ia'/></a></div>
                  </div>
                  <div class="comment_text">
                     <p><cms:show k_comment /></p>
                  </div>
               </div>
            </li>
            <cms:paginator />
            </cms:comments>
         </ol>
         <cms:else />
            No comments.
         </cms:if>
         
         <div class="hr clearfix">&nbsp;</div>
            </div><!--end comments class-->
         <!-- Comment Form -->
         <cms:embed 'comments_form.html' />

      </div>
   
      <!-- Column 2 / Sidebar -->
      
            
            </div>
         
      </div>
      </div><!--end blog wrapper-->
      
      <div class="innerpage_right">
         <cms:embed 'blog_sidebar.html' />
      </div>
      
      <!-- Footer -->
      <footer>
      <div id="footer_inner">
         <div class="footer-text">
            <div class="centered">
            <p>Email: <a href="mailto:jason@dubowmediation.net">jason@dubowmediation.net</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Phone: 954-925-8803</p> 
            <p>
            Dubow Mediation &copy; 2014 &nbsp;All Rights Reserved.</p>
               <div class="login"><a href="http://dubowmediation.net/news/">Login</a></div>
            </div>
         </div>
         
      </footer>
      <!-- \Footer -->
   
   </div>
   
   
   
   <!-- \Page Content -->
   
   </div>
   
   <script type="text/javascript" src="../js/jqueryEasing.js"></script>
   <script type="text/javascript" src="../js/jquery.js"></script>
   <script type="text/javascript" src="../js/infiniteSlider.js"></script>
   <script type="text/javascript" src="../js/ui.js"></script>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->   
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.js"></script>
   </body></html>
<cms:else />
   <cms:embed 'blog_list.html' />
</cms:if>

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


I changed the many things on the blog.php template but none of them are appearing on the site. Can anyone suggest how to troubleshoot this?

Thanks!

Steve
Hi Steve,

We need to distinguish between two things -
1. changes to *Couch tags* don't take effect v/s
2. changes to *anything* in the template do not take effect

Try making some changes to the HTML of the template e.g. add a <H1> block and see if it renders.

Please let me know what you see.
No changes made to the template are rendering. I updated the original post to add the code from the .php file. You can see that the menu, H1 and Page Title are not being reflected on the live site. It's as if I am editing a different file than the one being displayed, but I can't see how that could be possible.
In that case, Steve, it is not a Couch related problem.
You do seem to be editing the wrong file :)

In all probability the folder your site is residing in (www_root) is not what your FTP client is showing. This happens when the web host switches servers etc.
Please contact your host.
This is hosted on a VPS and I am the admin. I'm positive that I'm editing the right file. When I rename the file blog.php to blog2.php I get a 404. When I name it back to blog.php it shows. Is there a cache that needs to be cleared? Could it be something in the .htaccess file?

Just to be sure I ssh'd into the server and viewed the file using VI and it is indeed the file that I have been editing and uploading via SFTP.
Steve, are you certain that you are taking into account which view you are actually editing? From what I can gather, all of the list views are contained in blog_list.html and the page view is contained directly in blog.php. If you edit the code directly in blog.php, under the k_is_page condition, you will only see those changes reflected on a page such as http://dubowmediation.net/blog/whowins.html
You're right. The changes are appearing correctly in the individual post pages. What file do I need to edit to make them appear properly in the blog.php listing page. Could it be that I somehow have overwritten my original blog_list.html file and that is why the listing page is not rendering properly?

Thanks for your response!  :D
Sure Steve :)

You would edit blog_list.html to make changes to the list view. I wouldn't be able to provide much insight into the rendering issue. I can only suggest that you careful review the original code of both views for any discrepancies in the HTML markup. I always review the generated HTML for my projects in Firefox with the View Page Source tool as it highlights markup errors in red.
It turns out I *WAS* editing the wrong file. I wasn't editing the file in the /snippets folder. I was editing a copy of the file in the /couch root folder. Thanks @KK and @cheesyproof for your help in figuring this out! I really appreciate it.

Steve
9 posts Page 1 of 1