Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
15 posts Page 2 of 2
Thanks for sharing your solution with us Ketan :)
Hi, It's a little old add-on but still works. Thank You.

testing on CouchCMS Version 2.2.beta (20180619)

Please edit in the tutorial:
line 2:
Code: Select all
<script type="text/javascript" src="<cms:show k_admin_link />includes/jquery.min-1.5.1.js"></script>

to
Code: Select all
<script type="text/javascript" src="<cms:show k_admin_link />/includes/jquery-3.x.min.js"></script>
I will include this method for my site, looks cool.

However I was thinking (haven't found this question in the forum) Could I fetch page data from a list view using an ajax-like method?
I have a modal on the list-view that I want to dynamically populate with page-view data.

Has anyone come along such a post? I'm using UIkit for my frontend, the modal is derived from there :)
---
You live many times, but only ever remember your lives.length - 1
---
Image
The solution from @kk was a little bit to invasive to the theme, I was working on.

I found https://infinite-scroll.com/, which is very easy to implement. This is the simplified sourcecode:


Code: Select all
<div class="news row">
  <cms:pages orderby="weight" folder="<cms:show foldername />" limit="6" paginate="1">
    <div class="news__item col-lg-4 col-md-6 marginTop-30">
      <a href="<cms:show k_page_link />" class="news__link">
        <div class="news__card card">
          <div class="card-body">
            <strong><cms:show k_page_title /></strong>
          </div>
        </div>
      </a>
    </div>
    <cms:paginator />
  </cms:pages>
</div>



Putting in the footer:
Code: Select all
<script src="<cms:show k_site_link />assets/js/infinite-scroll.pkgd.min.js"></script>
<script>$('.news').infiniteScroll({path: 'a.next', append: '.news__item ', hideNav: '.pagination',});</script>
Thanks, Simon :)
Will try it out.
15 posts Page 2 of 2