entry-time in footer -> link to archive by date

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

entry-time in footer -> link to archive by date

Post by stm999999999 »

Some themes have the time / date of the entry in the footer:

it often looks lieke this:

author - categories - time - comments - trackbacks

There "time" links in most cases to the article themselves - something you did not need realy.


If you replace in

Code: Select all

{if $dategroup.is_sticky}
   <img src="/templates/{$template}/img/time.gif" style="border: 0px" title="{$CONST.ON}"  alt="{$CONST.ON}" />
{ else }
  <img src="/templates/{$template}/img/time.gif" style="border: 0px" title="{$CONST.AT}"  alt="{$CONST.AT}" />
{/if}
 <a href="{$entry.link}">{if $dategroup.is_sticky}{$entry.timestamp|@formatTime:DATE_FORMAT_ENTRY} {/if}{$entry.timestamp|@formatTime:'%H:%M'}</a>
the

Code: Select all

<a href="{$entry.link}">
with:

Code: Select all

<a href="/{$CONST.PATH_ARCHIVES}/{$entry.timestamp|@formatTime:'%Y'}/{$entry.timestamp|@formatTime:'%m'}/{$entry.timestamp|@formatTime:'%d'}.html">
the time will link to all the articles with the same date! :-)
Ciao, Stephan
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Great find, I agree that the default link is a bit redundant, but I remember emailing Garvin about this many months ago and his reason for leaving it in place was that some users have very long entries and a link to the detail page in the entry footer was useful.

Quite a few of the templates actually break this convention by placing the entry footer directly under the entry title so users still need to scroll to the top if they want to click into detail view, so in instances like that your fix would be very useful.

BTW, on my local PC the path didn't work and I had to add {$serendipityBaseURL} so that my link code looks like this

Code: Select all

<a href="{$serendipityBaseURL}{$CONST.PATH_ARCHIVES}
/{$entry.timestamp|@formatTime:'%Y'}/{$entry.timestamp|@formatTime:'%m'}/
{$entry.timestamp|@formatTime:'%d'}.html">
{$entry.timestamp|@formatTime:'%H:%M'}</a>
Thanks for sharing your code, Carl[/code]
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

... and his reason for leaving it in place was that some users have very long entries and a link to the detail page in the entry footer was useful.
Hm, I see the intention but which visitor would know, that the time is an entry-permalink? For this purpose I suggest to add a "Permalink"-entry in the footer, if someone wants this.
Thanks for sharing your code, Carl
no no, YOU share your code with the world! I only give a little bit back!
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I like the idea of having the time link to the archives page, I think it is definitely useful.

IMHO we could break with the existing convention here, and it seems that Carl and stm tend to agree with this?

However the code to be used needs to be tweaked a bit; in the current form it would be quite costy to perform those several function calls - so the link variable should be set within serendipity_printEntries().

I'll try to take care of this at the end of the week!

Best regards,
Garvin
# 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/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

That would be really groovy Garvin, I'll keep an eye open for it.
Post Reply