Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-07-28 09:02:33

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

[wiki] Comment_time format example

Would this be a valid example of the comment time tag using the format attribute with a custom strftime()

Comment block on public side…

On [date at [time], [commeter said …

Code…

<p class="small">On <txp:comment_permlink><txp:comment_time format="%d %b %Y" /></txp:comment_permlink> at <txp:comment_time format="%T" />, <txp:comment_name /> said ...</p>

Ed. It appears to work, so in terms of the attribute value construction, I guess it’s okay.

Last edited by Destry (2011-07-28 09:09:56)

Offline

#2 2011-07-28 09:17:48

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [wiki] Comment_time format example

I’d change class="small" into something that doesn’t specify what style it’ll get, like class="comment_header"

And perhaps another example to show that you put more than just %stuff in the format:

<p><txp:comment_time format="On %d %b %Y" at %T" />, <txp:comment_name /> said ...</p>

Offline

#3 2011-07-28 19:41:16

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: [wiki] Comment_time format example

Thanks, Ruud. Actually I didn’t mean for that class to be in the example at all (I don’t think it’s a very good one).

Good idea for another example too.

Offline

Board footer

Powered by FluxBB