Reputation: 35
I am using the apostrophe-blog module to create a blog on my website. I understand how to include a preview of each blog on my apostrophe-blog-pages/views/index.html page. I would like to include a preview of my most recently posted blog on my home page. Is there a way to get my apostrophe-blog-pieces data for my home page?
Upvotes: 1
Views: 220
Reputation: 2157
With apostrophe-blog-widgets
installed (part of the apostrophe-blog
bundle) you can add a blog widget to the homepage by adding a singleton somewhere in the homepage template like
{{ apos.singleton(data.page, 'blogPreview', 'apostrophe-blog') }}
Then configure the widget to pull from All with a limit of 1, this will pull the most recent post.
Customize the view by overriding lib/modules/apostrophe-blog/lib/modules/apostrophe-blog-widgets/widget.html
Upvotes: 3