Forum for discussing general topics related to Couch.
26 posts Page 2 of 3
Here is the current code.

Code: Select all
<!-- Content -->
  <div id="content">
    <section class="sub-banner" style="background:url(images/bg/blog-bg-1.jpg) fixed no-repeat">
      <div class="container">
        <div class="position-center-center">
          <h2>BLOG SPLIT POST</h2>
         
          <!--======= Breadcrumb =========-->
          <ol class="breadcrumb">
            <li><a href="#">Home</a></li>
            <li class="active">BLOG</li>
          </ol>
        </div>
      </div>
    </section>
   
    <!-- BLOG -->
    <section class="blog split-post padding-top-80 padding-bottom-80">
      <!-- TITTLE -->
      <div class="container">

<cms:pages masterpage='blogpost.php' paginate='1' limit='5' folder=k_folder_name include_subfolders='1' >   
<cms:if k_paginated_top >    
     <!-- Work Filter -->
      <ul class="tabs portfolio-filter text-center margin-bottom-80">    
      <cms:folders masterpage='blogpost.php'>    
      <li class="tab-title filter-item"><a href="<cms:show k_folder_link />" data-filter=".pf-branding-design"><cms:show k_folder_name /></a></li>        
     </cms:folders>
     </ul>
</cms:if>    
   
        <!-- BLOG POST -->
        <article class="blog-post">
          <div class="row">
           
            <!-- BLOG POST Image -->
            <div class="col-md-5">
              <div class="post-img"> <img src="<cms:show blog_image />" alt=""> </div>
            </div>
            <!-- BLOG POST CONTENT -->
            <div class="col-md-7"> <a href="#." class="tittle-post"><cms:show k_page_title /></a><span class="post-bt">by <span class="text-color-primary">Nick</span></span>
              <ul class="post-info">
                <li> <i class="fa fa-comments-o"></i>97 </li>
                <li> <i class="fa fa-eye"></i>565 </li>
                <li> <i class="fa fa-bookmark-o"></i><cms:show k_page_foldertitle /></li>
                <li> <span class="date font-crimson"><cms:date k_page_date format='j M' /></span> </li>
              </ul>
              <p><cms:show blog_content /></p>
              <a href="<cms:show k_page_link />" class="btn gray-border margin-top-20 text-normal">READ MORE</a> </div>
          </div>
        </article>
       
        <!-- PAGINATION -->
<cms:if k_paginated_bottom >
        <ul class="pagination">
      <cms:if k_paginate_link_prev >
          <li><a href="<cms:show k_paginate_link_prev />"<i class="fa fa-angle-left"></i></a></li>
      </cms:if> 
      <cms:if k_paginate_link_next >
          <li><a href="<cms:show k_paginate_link_next />"><i class="fa fa-angle-right"></i></a></li>
      </cms:if> 
        </ul>
      </div>
</cms:if>    
</cms:pages>
    </section>
  </div>
</div>
<!-- End Content -->
k_folder_name is a variable. It is being set only in folder-view. When you visit page in browser you can know which view you are on by looking at its url or, alternatively, by placing <cms:dump_all /> at some free place (outside of any loops, not inside of "cms:folders", or "cms:pages", etc). Dump also helps to see all available variables. Unfortunately, you posted an excerpt of your template, so I had to make this comment and assume that code doesn't work as expected because you simply not in a folder view, hence k_folder_name is empty.
@BrickTheNick. could you please zip the actual template and post it here as attachment?
@KK Here's my template.
Template Upload.zip
(5.6 KiB) Downloaded 392 times
Thanks. The template. however, caters only to the 'page_view' . The 'folder_view' (list_view using <cms:pages> loop) seems to be embedded in 'blog.html' snippet. Could you get us that snippet too?

Thanks.
My mistake! I meant to include that originally!

Here it is:
Template Upload (2).zip
(10.86 KiB) Downloaded 384 times


Thank you for taking the time to look over it!
Thanks.

I setup your templates on my system and found the following -

The main template (blogpost.php) embeds a snippet named 'blog.html' that is supposed to show the page listing under discussion -
Code: Select all
<cms:else />
    <cms:embed 'blog.html' />
</cms:if>

The zip that you sent me does *not* contain the snippet - rather it contains a file named 'blog.php' (notice the difference in extension).

Anyway, I placed that 'blog.php' in the snippets folder and changed the code in blogpost.php to embed it instead -
Code: Select all
<cms:else />
    <cms:embed 'blog.php' />
</cms:if>

The listing showed up fine. Tried out the menu showing the folders and the page listing changed accordingly.

So, your code is working (for me) as expected.
As to why it is not working on your end, I suspect you have been modifying the wrong snippet (i.e. been modifying blog.php but the main template was always loading a different template i.e. blog.html).

Could that be the case? Please check and let me know.

Thanks.
Also blog.php must be converted from template to a snippet to place it in snippets?
@KK I changed the .html to .php and placed the proper snippet in my snippets folder. Unfortunately, it still did not fix the issue. For some reason, if I left click on the element it will not sort the posts accordingly. However, if I right click and open in a new window, it opens a new page that is sorted properly.

I'm not sure why it isn't working on my end if it worked fine on yours.
It appears to some kind of a caching issue on your end.
Please clear your browser's cache completely and see if that helps.
26 posts Page 2 of 3