|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
danosirra Smarty n00b
Joined: 29 Oct 2006 Posts: 1
|
Posted: Sun Oct 29, 2006 3:29 pm Post subject: How to only display unique dates in my blog |
|
|
Hi all,
I want to have it so that the date appears before the blog entry, and, say, all three blog entries for that date appear after one another (without the date repeating).
I'm quite new to all this CSS and Smarty stuff, so forgive me (and be gentle). My site is www.osirra.com if that helps. For example, I have the date 25 October repeated a few times.
Not sure how to change my post.template to do this.
Can anyone help?
Dan. |
|
Back to top |
|
Hielke Hoeve Smarty Elite
Joined: 06 Jan 2006 Posts: 406 Location: Netherlands
|
Posted: Mon Oct 30, 2006 9:31 am Post subject: |
|
|
You could make triple arrays in php. The outer array for the date and the inners for the items. So that you would have:
Code: | Array {
"29 October 2006" => Array {
1 => Array { title = "foo", content => "bar" } },
"25 October 2006" => Array {
1 => Array { title = "foo", content => "bar" },
2 => Array { title = "foo", content => "bar" } }
} |
It might look a bit odd but for smarty coders quite easy to maintain. It's annoying to place if elses all over the tpl file. _________________ Debug XHTML Compliance
SmartyPaginate
Smarty License Questions
---
(About Unix) The learning curve is full of aha! moments, such as that glorious day that the full beauty of grep and, later, find is revealed in all its majesty. --- Robert Uhl <ruhl@4dv.net> |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|