CGBlog Pagination on Detail Pages

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
mr.bacan

CGBlog Pagination on Detail Pages

Post by mr.bacan »

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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: CGBlog Pagination on Detail Pages

Post by calguy1000 »

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,
The detail view has no concept of pagination, it is for displaying a single article. therefore by definition there is no pagination.

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.
mr.bacan

Re: CGBlog Pagination on Detail Pages

Post by mr.bacan »

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.
Thanks a lot for your answer CG, I've tried it like this...

Code: Select all

{cgblog_relative_article article=$entry->url dir="next" assign="nextID"} (at the top of the template)
<a href="{$nextID}">Next</a>
But this didn't worked. I then tried article=$entry->id and it generates a link with the ID number (http://www.aliendefendermaky.com/102) but the pages have pretty url's and look like this http://www.aliendefendermaky.com/2015/1 ... age-6.htmlIs it possible to get the full url for each link?
mr.bacan

Re: CGBlog Pagination on Detail Pages

Post by mr.bacan »

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.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: CGBlog Pagination on Detail Pages

Post by Rolf »

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>&nbsp;&nbsp;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&nbsp;&nbsp;<span class="fa fa-arrow-circle-right"></span>
	</a>
{/if}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: CGBlog Pagination on Detail Pages

Post by Rolf »

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
- + - + - + - + - + - + -
Image
mr.bacan

Re: CGBlog Pagination on Detail Pages

Post by mr.bacan »

Thanks so much for your suggestions Rolf, I'll try them and let you know how it went.
mr.bacan

Re: CGBlog Pagination on Detail Pages

Post by mr.bacan »

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>&nbsp;&nbsp;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&nbsp;&nbsp;<span class="fa fa-arrow-circle-right"></span>
	</a>
{/if}
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?

Thanks again for all the help.
Locked

Return to “Modules/Add-Ons”