[SOLVED] CGBlog: show article titles in archive list

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
10010110
Translator
Translator
Posts: 224
Joined: Tue Jan 22, 2008 9:57 am

[SOLVED] CGBlog: show article titles in archive list

Post 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.
Last edited by 10010110 on Wed Jul 20, 2011 3:57 pm, edited 1 time in total.
uniqu3

Re: CGBlog: show article titles in archive list

Post 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
10010110
Translator
Translator
Posts: 224
Joined: Tue Jan 22, 2008 9:57 am

Re: CGBlog: show article titles in archive list

Post 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.
Bilmartech
Forum Members
Forum Members
Posts: 50
Joined: Mon Feb 21, 2011 2:08 am

Re: [SOLVED] CGBlog: show article titles in archive list

Post 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.
uniqu3

Re: [SOLVED] CGBlog: show article titles in archive list

Post by uniqu3 »

You need to assign the title first in your Blog template.
Something like {assign var='blog_article_name' value=$entry->title}
Bilmartech
Forum Members
Forum Members
Posts: 50
Joined: Mon Feb 21, 2011 2:08 am

Re: [SOLVED] CGBlog: show article titles in archive list

Post 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!
Bilmartech
Forum Members
Forum Members
Posts: 50
Joined: Mon Feb 21, 2011 2:08 am

Re: [SOLVED] CGBlog: show article titles in archive list

Post 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.
urbansaint
New Member
New Member
Posts: 6
Joined: Wed Aug 17, 2011 5:58 am

Re: [SOLVED] CGBlog: show article titles in archive list

Post 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


Last bumped by urbansaint on Thu Sep 22, 2011 11:56 pm.
Post Reply

Return to “Modules/Add-Ons”