CGBlog Issue

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
georgechr
Forum Members
Forum Members
Posts: 96
Joined: Tue Sep 13, 2011 6:02 am

CGBlog Issue

Post by georgechr »

Hey everyone,

I am having trouble getting CGBlog to work like i want. Here is the deal:

I have created 2 summary templates (homepage and secondpage) and one detail template (detail).

My homepage will show a couple of news (summary homepage) and the second page will display a list with all the months so the user can click on the month and view the posts for that month.

I managed to make the previous work at 50%. I managed to get the homepage when clicked to go to a specific detail page and it seems to work great:
{CGBlog category="English" summarytemplate="homepage" detailtemplate="detail" detailpage="news-coverage-ten" pagelimit="3" sortby="cgblog_date"}
My main problem now lays on the actual second page. This is where i would like the month list to appear (archive) and when clicked to display the summaries. here is my page code:
{CGBlog action="archive" category="English" summarypage="news-coverage-ten" detailpage="news-coverage-ten" sortby="cgblog_date"}
It seems that CGBlog ignores my "summarypage" or "detailpage" and shows the list on my homepage where the "{content} tag is.

The only way to make it work, is to go into options and select from the summary view options, the default summary and detail page. This would be ok if i had one language, though i will have 4 languages so this is not ok.

I just dont understand why the summarypage is ignored when using "archive" as action and why they are displayed on homepage.

Thanks in advance.

Below are my templates codes if they are needed.

PS: Why is there no "return link" url like in News module? Is this something i simply havent found/seen ? I ended up using a javascript goback history.

Blog - Summary (Homepage)
{foreach from=$items item=entry}
{if $entry->postdate}
<table border="0" cellspacing="0" cellpadding="0" class="newsdateback">
<tr>
<td><div class="NewsSummaryPostdateDay">{$entry->postdate|date_format:"%d&nbsp;"}</div></td>
<td><div class="NewsSummaryPostdateMonth">{$entry->postdate|date_format:"%b"}</div></td>
</tr>
</table>
{/if}
<div class="NewsSummaryLink">
<a href="{$entry->detail_url}" title="{$entry->title|escape:htmlall}">{$entry->title|escape}</a>
</div>
{if $entry->summary}
<div class="NewsSummarySummary">
{eval var=$entry->summary}
</div>
{/if}
<br>
{/foreach}
Blog - Summary (Secondpage)
{if isset($error)}{cgerror}{$error}{/cgerror}{/if}
{foreach from=$items item=entry}
{if $entry->postdate}
<table border="0" cellspacing="0" cellpadding="0" class="newsdateback">
<tr>
<td><div class="NewsSummaryPostdateDay">{$entry->postdate|date_format:"%d&nbsp;"}</div></td>
<td><div class="NewsSummaryPostdateMonth">{$entry->postdate|date_format:"%b"}</div></td>
</tr>
</table>
{/if}
<div class="NewsSummaryLink">
<a href="{$entry->detail_url}" title="{$entry->title|escape:htmlall}">{$entry->title|escape}</a>
</div>
{if $entry->summary}
<div class="NewsSummarySummary">
{eval var=$entry->summary}
</div>
{/if}
<br>
{/foreach}
{if $pagecount > 1}
<p>
{if $pagenumber > 1}
{$firstpage}&nbsp;{$prevpage}&nbsp;
{/if}
{$pagetext}&nbsp;{$pagenumber}&nbsp;{$oftext}&nbsp;{$pagecount}
{if $pagenumber < $pagecount}
&nbsp;{$nextpage}&nbsp;{$lastpage}
{/if}
</p>
{/if}
Blog - Detail
{if isset($entry->canonical)}
{assign var='canonical' value=$entry->canonical}
{/if}

{if $entry->postdate}
<table border="0" cellspacing="0" cellpadding="0" class="newsdateback">
<tr>
<td><div class="NewsSummaryPostdateDay">{$entry->postdate|date_format:"%d&nbsp;"}</div></td>
<td><div class="NewsSummaryPostdateMonth">{$entry->postdate|date_format:"%b"}</div></td>
</tr>
</table>
{/if}

<h3 id="CGBlogPostDetailTitle">{$entry->title|escape}</h3>

<div id="CGBlogPostDetailContent">
{eval var=$entry->content}
</div>

<br><a href="javascript:history.go(-1)">Go Back</a>


{if $entry->extra}
<div id="CGBlogPostDetailExtra">
{$extra_label} {$entry->extra}
</div>
{/if}

{if isset($entry->fields)}
{foreach from=$entry->fields item='field'}
{* the field is an object.. available members are:
alias id, name, type, max_length, create_date, modified_date, item_order, public, and value.
i.e: {$field->name} will output the name: {$field->alias} will output the alias.
*}
<div class="CGBlogDetailField">
{if $field->type == 'file'}
{* this template assumes that every file uploaded is an image of some sort, because CGBlog doesn't distinguish *}
<img src="{$entry->file_location}/{$field->value}"/>
{else}
{$field->name}:&nbsp;{eval var=$field->value}
{/if}
</div>
{/foreach}

{/if}
Post Reply

Return to “Modules/Add-Ons”