Hi, I've been using CGBlog Module for a client with great results. I've only needed to use the summary template to show weekly images, but now the client wants to add comments and facebook like button to each post, so I need to use the detail template to accomplish that, but I haven't been able to generate a pagination on detail pages. Is that possible? Pagination works great on summary templates but not otherwise.
Here's a link to the website so you have an idea. http://www.aliendefendermaky.com/en/story.html
Cms Version: 1.12.1
Installed Modules:
CMSMailer: 5.2.2
CMSPrinting: 1.0.5
FileManager: 1.4.5
MenuManager: 1.8.7
MicroTiny: 1.2.9
ModuleManager: 1.5.8
News: 2.15.2
Search: 1.7.13
ThemeManager: 1.1.8
Gallery: 2.0.3
FormBuilder: 0.8.1.2
TinyMCE: 2.9.12
CGSimpleSmarty: 1.9.1
CGExtensions: 1.49.11
CGContentUtils: 1.5.1
MleCMS: 1.11.4
CGSmartImage: 1.20.3
JQueryTools: 1.3.7
CGBlog: 1.13.2
Products: 2.24.2
CGFeedback: 1.7.5
Thanks in advance.
CGBlog Pagination on Detail Pages
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: CGBlog Pagination on Detail Pages
The detail view has no concept of pagination, it is for displaying a single article. therefore by definition there is no pagination.but now the client wants to add comments and facebook like button to each post, so I need to use the detail template to accomplish that,
There is a {cgblog_relative_article} plugin that can get the next and previous article by ascending date... but that plugin does not support filtering by category.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: CGBlog Pagination on Detail Pages
Thanks a lot for your answer CG, I've tried it like this...calguy1000 wrote:There is a {cgblog_relative_article} plugin that can get the next and previous article by ascending date... but that plugin does not support filtering by category.
Code: Select all
{cgblog_relative_article article=$entry->url dir="next" assign="nextID"} (at the top of the template)
<a href="{$nextID}">Next</a>
Re: CGBlog Pagination on Detail Pages
I've been cracking my head off to get and answer for this with no luck, so I tried adding the CGFeedback module to the summary template and it worked perfectly, so I think this is the way I'll keep working. The downside is that I now also need a page listing all posts as a text link, but don't know if it's possible to link to a specific summary page automatically.
I would appreciate if someone with a solution could give me a hand.
Thanks in advance.
I would appreciate if someone with a solution could give me a hand.
Thanks in advance.
Re: CGBlog Pagination on Detail Pages
At www.cmscanbesimple.org/blog I use for previous/next buttons:
Code: Select all
{cgblog_relative_article article=$entry->id dir=prev assign=prev_id}
{cgblog_relative_article article=$entry->id dir=next assign=next_id}
{if !empty($prev_id)}
<a class="btn btn_grey" href="{module_action_link module='CGBlog' action='detail' articleid=$prev_id urlonly='1'}">
<span class="fa fa-arrow-circle-left"></span> Previous article
</a>
{/if}
{if !empty($next_id)}
<a style="float: right" class="btn btn_grey" href="{module_action_link module='CGBlog' action='detail' articleid=$next_id urlonly='1'}">
Next article <span class="fa fa-arrow-circle-right"></span>
</a>
{/if}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: CGBlog Pagination on Detail Pages
For a summary list view of articles you can use something like
Code: Select all
<ul>
{foreach from=$items item=entry}
<li><a href="{$entry->detail_url}" title="{$entry->title|escape:htmlall}">{$entry->title|escape}</a></li>
{/foreach}
</ul>
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: CGBlog Pagination on Detail Pages
Thanks so much for your suggestions Rolf, I'll try them and let you know how it went.
Re: CGBlog Pagination on Detail Pages
Thanks so much Rolf, this definitely solved the link issue, I just added an {else} to match on/off icons. There are also a couple of links to get the First and Last post, is it possible to get those links using the {module_action_link} tag you used?Rolf wrote:Code: Select all
{if !empty($prev_id)} <a class="btn btn_grey" href="{module_action_link module='CGBlog' action='detail' articleid=$prev_id urlonly='1'}"> <span class="fa fa-arrow-circle-left"></span> Previous article </a> {/if} {if !empty($next_id)} <a style="float: right" class="btn btn_grey" href="{module_action_link module='CGBlog' action='detail' articleid=$next_id urlonly='1'}"> Next article <span class="fa fa-arrow-circle-right"></span> </a> {/if}
Thanks again for all the help.