Different archives logic

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Different archives logic

Post by yellowled »

I'm working on a template for a blog which will have very few entries, probably not more than one per month. So our traditional archives page (archives/summary) doesn't make much sense. Then again, I'd rather have an archive page generated automagically than manually build one using a static page.

Any chance I can tweak the entries_archives.tpl to emit a list of entries per year?

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Different archives logic

Post by Timbalu »

Hi YL

This little tweek helped me in these situation.
Maybe its not actually want you want, but it could be a hint:

entries_archives.tpl:

Code: Select all

{if $month.entry_count > 0}
    <ul class="archives_row {cycle values='archives_row_odd,archives_row_even'}">

     .................................

    </ul>
{/if}
Ian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Different archives logic

Post by yellowled »

Timbalu wrote:Maybe its not actually want you want
No, I'd basically like to have the list of entries as it is not emitted by entries_summary.tpl, only within the yearly context of the entries_archives.tpl.

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Different archives logic

Post by Timbalu »

what about working with serendipity_event_customarchive.php?
Read thread http://board.s9y.org/viewtopic.php?f=10&t=16841
mabe this will point in a better direction... ;-)

Ian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Different archives logic

Post by yellowled »

Jeez. This is actually easy-peasy if you think about it.

entries_archives.tpl:

Code: Select all

{foreach from=$archives item="archive"}
    <div class="archive-year">
        <h3>{$archive.year}</h3>
        {serendipity_fetchPrintEntries range="$archive.year" full=false fetchDrafts=false noSticky=true}
    </div>
{/foreach}
Combine this with a template for the fetchPrintEntries call to customize the article output (i.e. items of an unordered list), and you're done.

YL
Post Reply