2

I'm quite new on apostrophe-cms but so far I've been able to dig a little around all the main features of this CMS (tutorials, customed widgets, templating,...) and I've successfully integrated the apostrophe-blog plugin and made it work properly as it is demonstrated into the apostrophe-sandbox project on github.

Yet I couldn't really understand how I could catch the next and prev article's url in order to display a button directly inside the show.html file (which is located in the lib/modules/apostrophe-blog-pages/views/ directory.)

Is there a way to bind to the {{ data.pieces }} available inside the index.html (the page that display a blog's articles list, in the same directory) so that I could eventually make a function that would give me an intended {{ data.pieces[n]._url }} corresponding to each articles ?

Cuz so far I could only get a sort of much "local" data.piece in show.html that seems to concerns only each specific article that are displayed on this page. (for the notice I use {{ data.piece | dump }} nunjuck's property to display it)

Thanks by advance for any helping answers around this topic, and hope I could make my request enoughly explicit to everyone !?

flowstack
  • 21
  • 3
  • 3
    In the last release of Apostrophe new data.previous and data.next options have been added to the apostrophe-pieces-page in order to use it for example in the case of apostrophe-blog module : http://forum.apostrophecms.org/t/apostrophe-2-29-0-2-30-0-multiple-select-filters-in-manage-pieces-next-and-previous-easy-redis-sessions-accommodations-for-the-workflow-module/215 – flowstack Aug 10 '17 at 14:47

1 Answers1

0

As noted by the OP, setting the next: true, previous: true, options on the apostrophe-blog-pages module will make data.next and data.previous objects available (that can also be limited using a projection property) in the show.html template. Those will include the _url property to link to.

alexbea
  • 1,311
  • 14
  • 25