Styling the archives
Posted: Mon Jun 04, 2007 7:00 pm
Hey,
i started to edit the .tpl files for the arrchives today and got stuck in the entries_archives.tpl, because i started to show the months in an different order than in the default view and without the table that existed before.
In the end it should look something like that wordpress archive. This is how i did it:
The code past the is 'stolen' form the entries_summary.tpl. I think that's the problem I got. Because anything to this point works perfect, but the entries aren't listed under the months. I really don't know why and I hope you could spend some help!
[/url]
i started to edit the .tpl files for the arrchives today and got stuck in the entries_archives.tpl, because i started to show the months in an different order than in the default view and without the table that existed before.
In the end it should look something like that wordpress archive. This is how i did it:
Code: Select all
{serendipity_hookPlugin hook="entries_header"}
<h2 class="serendipitysidebartitle">{$CONST.ARCHIVES}</h2>
{foreach from=$archives item="archive"}
{foreach from=$archive.months item="month"}
<div class="archive_month">
<b>{if $month.entry_count}<a href="{$month.link}">{/if}{$month.date|@formatTime:"%B"} {$archive.year}{if $month.entry_count}</a>{/if}</b> {$month.entry_count} {$CONST.ENTRIES}
</div><br>
{foreach from=$entries item="entries"}
{foreach from=$entries.entries item="entry"}
<a href="{$entry.link}">{$entry.title}</a>
{/foreach}
{/foreach}
{/foreach}
{/foreach}
<div class="serendipity_pageFooter" style="text-align: center">
{serendipity_hookPlugin hook="entries_footer"}</div>
Code: Select all
<div class="archive month>...</div><br>[/url]