Archive summary alternative template

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Archive summary alternative template

Post by Don Chambers »

So, in archives, we often have an option to display all entries (using entries.tpl) for a specific month:

Code: Select all

{if $month.entry_count}<a href="{$month.link}">{/if}{$CONST.VIEW_FULL}{if $month.entry_count}</a>{/if}
or build a simple list of entries (using entries_summary.tpl) for a specific month:

Code: Select all

{if $month.entry_count}<a href="{$month.link_summary}">{/if}{$CONST.VIEW_TOPICS}{if $month.entry_count}</a>{/if}
I would like to do something similar to entries_summary. I do want to iterate through all entries for a specific month, but I want the output to be more than what entries_summary.tpl typically contains, but much less than what entries.tpl is used for. Essentially, a hybrid between the two.

We have a number of features that allow us to specify a specific tpl to use when formatting output, such as serendipity_fetchPrintEntries, serendipity_printSidebar, as well as a number of plugins whose output can be altered when using a custom, predetermined tpl file in a template folder.

I do not think I can use serendipity_fetchPrintEntries because I am not trying to include the output within an existing page - I am trying to generate unique page content formatted via a custom tpl.

Anyone know if this can be done?
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Archive summary alternative template

Post by yellowled »

Not sure if I get what you mean, but I think I did something like that for the archives page of the German s9y podcast. http://www.s9ycamp.info/archives/

But that simply uses serendipity_showPlugin to emit the output of the recententries plugin, which is not very flexible.

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Archive summary alternative template

Post by Don Chambers »

Thanks. Emitting the results of a plugin is something I already know how to do. What I want the ability to have a monthly summary, but specify a smarty template other than entries_summary.tpl, so I could have one version that is a list of entries, but perhaps a second version that would use an extended property (an image) that becomes a link to the entry instead of a just a text list of entry titles.

If I didn't want both, I would just modify entries_summary.tpl to be this alternate version, but I want both.... one that is a text list, and one that is more of a graphical list.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Archive summary alternative template

Post by garvinhicking »

Hi!

Yeah...this view does not query the usual entries database table, so most data is not accessible.

You can't really mix and match the queries needed for usual entries.tpl and the summary view, because it doesn't fetch individual articles.

I don't see how this could be done. I would either suggest

a.) Creating a plugin for this with its own view like /plugin/MyMonthView (external_plugin hook), and that uses distinct, custom SQL queries to exactly fetch what is needed. Obviously, this is the complicated (but custom) route. ;)

b.) Inside the loops, use the fetchPrintries function with specific date ranges (of the month that is being iterated) to create a list of entries and display those specifically. Or, maybe even better, create a custom Smarty function that you can call at this place, and let the config.inc.php handle the specific custom SQL query of the data you want to fetch. Obviously, this is also a bit complicated. ;-)
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply