Page 1 of 1
[SOLVED] CGBlog: show article titles in archive list
Posted: Wed Jul 20, 2011 12:04 pm
by 10010110
So, I’m using the blog module by calguy1000 and it’s working great in its default state. However, I’m trying to list old articles grouped by their respective month they were posted in. The archive action/template only lists the months and a number of posts in bracktes, like:
Code: Select all
June 2011 – (2)
May 2011 – (8)
April 2011 – (13)
I can’t seem to figure out how to make it like:
Code: Select all
June 2011
06/22 – Article title
06/15 – Article title
May 2011
05/12 – Article title
05/08 – Article title
05/03 – Article title
April 2011
04/12 – Article title
04/08 – Article title
04/03 – Article title
…
Also, is there any documentation on which smarty variables are available for use? Or are the variables like {$one.summary_url}, {$one.count}, etc. on the default templates the only ones?
I’d greatly appreciate any help and ideas.
Re: CGBlog: show article titles in archive list
Posted: Wed Jul 20, 2011 1:23 pm
by uniqu3
You can get available variables with print_r
<pre>{$one|print_r}</pre>
To your question maybe this topic can help you?
http://forum.cmsmadesimple.org/viewtopi ... ry#p240047
Re: CGBlog: show article titles in archive list
Posted: Wed Jul 20, 2011 3:55 pm
by 10010110
You da man!!!
Just for the records, this is what my archive template looks like now:
Code: Select all
{if isset($archivelist)}
<ul class="archivelist">
{foreach from=$archivelist item=one}
<li>
<a href="{$one.summary_url}">{$one.datestamp|date_format:"%B"} {$one.datestamp|date_format:"%Y"}</a> ({$one.count})
<div class="articles">
{capture assign='theyear'}{$one.datestamp|date_format:"%Y"}{/capture}
{capture assign='themonth'}{$one.datestamp|date_format:"%m"}{/capture}
{CGBlog year="$theyear" month="$themonth" summarytemplate="[custom template here]"}
</div>
</li>
{/foreach}
</ul>
{/if}
It shows the month list with the article sub list under each month. I’m using a custom summary template that shows the article date and the title only.
Re: [SOLVED] CGBlog: show article titles in archive list
Posted: Sat Aug 06, 2011 12:34 am
by Bilmartech
Good Stuff... Question.. I am trying to get the title only of the blog so in the default template I can do something like this:
{if isset($blog_article_name)}<h2>{$blog_article_name}</h2>{else}<h2>{title}</h2>{/if}
Instead of having the page title displayed.
Any help or input is appreciated.
Re: [SOLVED] CGBlog: show article titles in archive list
Posted: Sat Aug 06, 2011 8:24 am
by uniqu3
You need to assign the title first in your Blog template.
Something like {assign var='blog_article_name' value=$entry->title}
Re: [SOLVED] CGBlog: show article titles in archive list
Posted: Sat Aug 13, 2011 10:31 pm
by Bilmartech
uniqu3 wrote:You need to assign the title first in your Blog template.
Something like {assign var='blog_article_name' value=$entry->title}
Perfect.. working like a charm.. Thanks!
Re: [SOLVED] CGBlog: show article titles in archive list
Posted: Wed Aug 17, 2011 11:48 pm
by Bilmartech
Another Question...
Is there a way to "force" a pagelimit in the sample template itself? On a standard call it would look something like this:
{CGBlog number='4' summarytemplate="sampleside"}
But I am using tags and have created a custom browse template of cloud tags (gotten from this forum) and it creates category links that when clicked on, it displays all the blog post from that particular category.
Here is the Cloud Template:
{assign var=maxcount value=0}
{foreach from=$categories item='one'}
{if $one.count gt $maxcount}{assign var=maxcount value=$one.count}{/if}
{/foreach}
{foreach from=$categories item='one'}
<a href="{$one.url}" title="{$one.name}"
class="cloud_{math|round equation="(currentCount / maxCount * 10)" currentCount=$one.count maxCount=$maxcount}" >{$one.name}</a>
{/foreach}
Since it's just generates a link and not actually calling a template, I can't figure out a way to insert a number limit either from the cloud template or force the sample template to just show say 10 entries and then add the page links to the bottom of it.
Some of my categories have 50+ post and it pushes the height of the page really far down.
Any help is appreciated.
Re: [SOLVED] CGBlog: show article titles in archive list
Posted: Thu Sep 22, 2011 11:56 pm
by urbansaint
10010110 wrote:So, I’m using the blog module by calguy1000 and it’s working great in its default state. However, I’m trying to list old articles grouped by their respective month they were posted in. The archive action/template only lists the months and a number of posts in bracktes, like:
Code: Select all
June 2011 – (2)
May 2011 – (8)
April 2011 – (13)
I can’t seem to figure out how to make it like:
Code: Select all
June 2011
06/22 – Article title
06/15 – Article title
May 2011
05/12 – Article title
05/08 – Article title
05/03 – Article title
April 2011
04/12 – Article title
04/08 – Article title
04/03 – Article title
…
Also, is there any documentation on which smarty variables are available for use? Or are the variables like {$one.summary_url}, {$one.count}, etc. on the default templates the only ones?
I’d greatly appreciate any help and ideas.
Dear Friend,
Can u please explain the step by step process of how you created the blog like this???
Thanks with regards,
Sathish Narasimhan