Page 4 of 4

Re: [SOLVED] News Archives by Year/Month

Posted: Thu Aug 04, 2011 12:06 pm
by tamsrud
jlmcm wrote:
I just tried this, and it doesn't work (for me at least).
You must have two different news templates. One for the archive list, and one for showing the news with title and description.

In other words, first you must show the archive list with a code similar to:
{news summarytemplate='archive_list'}
Where archive_list is the template i described.

And then in the page news-archive show the full text with a code similar to:
{news summarytemplate="news_archive" start=$startpost pagelimit=$numposts}
Where news_archive is a template similar to the Sample template.

Re: [SOLVED] News Archives by Year/Month

Posted: Tue Apr 17, 2012 6:06 am
by berg3n
Works great, but you may need to change ?startpost to &startpost in the summary template to get it work

Re: News Archives by Year/Month

Posted: Mon Nov 11, 2013 10:36 am
by Calimer0
sam_butler wrote: Yeah, I did that just now... UDT called 'news_archive_sidebar' with comments:
Might be useful to someone...
A small change in the code of sam_butler. This will make the UDT also work on Smarty v3 which is used in the newer CMSMS.

Code: Select all

$smarty_data = "{cms_selflink href='lbjaar}"; //this is the archive link
$smarty->_compile_source('temporary template', $smarty_data, $_compiled );
@ob_start();
$smarty->_eval('?>' . $_compiled);
$_contents = @ob_get_contents();
@ob_end_clean();
$archivelink = $_contents;
Is replaced by:

Code: Select all

$smarty_data = "{cms_selflink href='lbjaar'}"; //this is the archive link
$archivelink = $smarty->fetch('string:'.$smarty_data);