Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Hi,

I'm trying to find a way to exclude a div group from the <cms:pages> tag. In the codes below, I'd like to exclude lines 4-15 from being duplicated. You can also see the visual in the attached image. Its just a block quote above the pagination which is not meant to be repeated.

Code: Select all
<cms:pages masterpage='news.php' paginate='1' limit='3'>
[b]Other divs here[/b]
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <div class="post-block post-quote">
                        <div class="row ">
                            <!-- post block -->
                            <div class="col-md-12">
                                <div class="quote-content">
                                    <blockquote>“simple html templates free download. men hair salon website templates”</blockquote>
                                </div>
                            </div>
                            <!-- /.post block -->
                        </div>
                    </div>
                </div>
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <cms:if k_paginated_bottom >
                    <div class="st-pagination">
                        <ul class="pagination">
                            <li>
                     <cms:if k_paginate_link_prev >
                                <a href="<cms:show k_paginate_link_prev />" aria-label="Previous">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                     </cms:if>
                            </li>
                            <li class="active"><a href="#">1</a></li>
                            <li><a href="#">2</a></li>
                            <li><a href="#">3</a></li>
                            <li><a href="#">4</a></li>
                            <li><a href="#">5</a></li>
                            <li>
                     <cms:if k_paginate_link_next >
                                <a href="<cms:show k_paginate_link_next />" aria-label="Next">
                                    <span aria-hidden="true">&raquo;</span>
                                </a>
                      </cms:if>
                            </li>
                        </ul>
                    </div>
            </cms:if>
                </div>
            </cms:pages>



I hope someone could help. Thanks!

Attachments

Sierra, you can try to use k_count to only show that div on the first result.

See below code, hope this helps.

Code: Select all
<cms:if k_count eq '1'>
   <div class="post-block post-quote">
       <div class="row ">
           <!-- post block -->
           <div class="col-md-12">
               <div class="quote-content">
                   <blockquote>“simple html templates free download. men hair salon website templates”</blockquote>
               </div>
           </div>
           <!-- /.post block -->
       </div>
   </div>
</cms:if>
Blutbaden,

Thank you for your reply. Awesome- I applied what you gave and the code worked that it doesn't repeat the div any longer. However, the position of the div is now underneath the first blog post preview. :cry: You may see it on the attached image. The div was just meant to be above the pagination and below all the blog post results :(

Attachments

Sierra,

Please make sure that directly after the <cms:pages> we start with the k_count:

Code: Select all
<cms:pages masterpage='news.php' paginate='1' limit='3'>
    <cms:if k_count eq '1'>
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="post-block post-quote">
....etc

[b]Other divs here[/b]
Hi,

I did the code above but did not show what I was hoping to achieve :( The list is supposed to be 3 but the blockquote should stay at the bottom. In the attached image is what I am looking to achieve. The block quote is just right above the pagination and below all the listed blog posts.

Thanks so much.

Attachments

@sierratangofox,

As the cms:pages tag goes about looping through the pages, you can use the 'k_paginated_top' and 'k_paginated_bottom' variables to target the first and the last pages respectively.

Since you are interested in displaying the quote after the last page has been displayed, wrap the quote in a conditional 'k_paginated_bottom' as follows and it will display only in the last iteration -
Code: Select all
<cms:pages masterpage='news.php' paginate='1' limit='3'>

    [b]Other divs here[/b]


    <cms:if k_paginated_bottom >
         <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="post-block post-quote">
                <div class="row ">
                    <!-- post block -->
                    <div class="col-md-12">
                        <div class="quote-content">
                            <blockquote>“simple html templates free download. men hair salon website templates”</blockquote>
                        </div>
                    </div>
                    <!-- /.post block -->
                </div>
            </div>
        </div>
    </cms:if>
   
    ..
    ..

</cms:pages>

Hope this helps.
Awesome! Thanks a lot! :D I attached the image with the result.

Attachments

7 posts Page 1 of 1

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 4 guests

cron