Forum for discussing general topics related to Couch.
26 posts Page 1 of 3
Hello, I am following the blog tutorial. I have created folders, and sorted my articles into them, and i have created the page which lists all of the articles. I cannot make this page list only the articles from the specified folder.

Here is my code.
Code: Select all
<!-- BLOG -->
    <section class="blog split-post padding-top-80 padding-bottom-80">
      <!-- TITTLE -->
      <div class="container">
    
     <!-- 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:pages masterpage='blogpost.php' paginate='1' limit='5' >       
        <!-- 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>


Hopefully someone can point me in the proper direction as to what I am doing wrong! Thanks!
Hi

You probably looking for this info from the documentationhttp://docs.couchcms.com/tags-reference/pages.html

example from taken from there....

Code: Select all
<cms:pages masterpage='blog.php' folder='classic-bikes' include_subfolders='1'></cms:pages>
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
Hello, did you try following?
<cms:pages masterpage='blogpost.php' folder=k_folder_name include_subfolders='1' paginate='1' limit='5' >
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
trendoman wrote: Hello, did you try following?
<cms:pages masterpage='blogpost.php' folder=k_folder_name include_subfolders='1' paginate='1' limit='5' >


Unfortunately, this didn't work. Do I have the code arranged wrong? Is something out of place?

I should mention that the folders are being listed just fine, I just cannot show only the associated posts for each folder.
I have amended some of the code, and have tried rearranging it every way I can think of. Still no dice.
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_page_foldername' 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 -->


It is listing the folders just fine, but not showing only the articles from the selected category.

Also, if I change the k_folder_name in the pages line to the name of a folder, it does display just the blog posts related to that folder.
<cms:pages masterpage='blogpost.php' paginate='1' limit='5' folder='k_page_foldername'

Two problems -
1. You are using quotes around k_page_foldername which is making cms:pages think that it is literally the name of a folder.
It is, in reality, a variable so should not have any surrounding quotes (please see http://docs.couchcms.com/concepts/setti ... eters.html if this confuses you).

2. The correct variable name is k_folder_name and not k_page_foldername (assuming you are dealing with a folder-view).

The right code is what @trendoman had provide -
<cms:pages masterpage='blogpost.php' folder=k_folder_name


Hope this helps.
KK wrote:
<cms:pages masterpage='blogpost.php' paginate='1' limit='5' folder='k_page_foldername'

Two problems -
1. You are using quotes around k_page_foldername which is making cms:pages think that it is literally the name of a folder.
It is, in reality, a variable so should not have any surrounding quotes (please see http://docs.couchcms.com/concepts/setti ... eters.html if this confuses you).

2. The correct variable name is k_folder_name and not k_page_foldername (assuming you are dealing with a folder-view).



I have applied both of these changes. No dice. Still not working.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate



I have actually searched and read through all of these. The code I have implemented SHOULD be working. It just is not. I must have something out of place, but I cannot figure it out. Unless it is just going right over my head, I cant find it.
Okay, would you then attach the code and we try to resolve the issue or at least strike out one reason and look for others?
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
26 posts Page 1 of 3
cron