Hi - Just wondering if anyone can help me with a news template? I need to be able to group news by month (just like this http://www.dundeereit.com/NewsEvents-PressRel2006.html) and am not sure where to start.
Code samples or links would be greatly appreciated.
Cheers,
David
Smarty New Template Help
Re: Smarty New Template Help
You could put them in monthly categories and call the categories in each div...
-
Kavrick
Re: Smarty New Template Help
Wow - I wrote that late last night and wasn't nearly specific enough... Sorry about that Mark.
I've actually already got my news posts in categories by month... What I was hoping for was a way for the press release page to recognise the current month and start displaying the previous month's entries by working backwards from the current month.
I'm really just looking to simplify the admin of this page.
Is there a way for Smarty to grab the current month (based on server values) and then just display backwards from there?
Let me know if I'm not making any sense!
David
I've actually already got my news posts in categories by month... What I was hoping for was a way for the press release page to recognise the current month and start displaying the previous month's entries by working backwards from the current month.
I'm really just looking to simplify the admin of this page.
Is there a way for Smarty to grab the current month (based on server values) and then just display backwards from there?
Let me know if I'm not making any sense!
David
Re: Smarty New Template Help
iirc $smarty.now has current datetime and you can of course specify only moth with something like $smarty.now|date_format %m, but check the right syntax from smarty manual
-
Kavrick
Re: Smarty New Template Help
Thanks for the suggestions... Any good links to Smarty Tutorials?
David
David
-
Kavrick
Re: Smarty New Template Help
Thanks for everyone's suggestions. I got it figured out and thought I'd share. Before anyone rips into me about using tables... I know. This was a time sensitive thing and I had to blast it up quick. I'll convert it to CSS later... I swear! 
Since I have each press release categorized by Year, Month I created this little template and essentially made 12 calls to each individual monthly category.
The Template looks like this...
{foreach name="dategroup" from=$items item=entry}
{if $smarty.foreach.dategroup.first}
{$entry->category}
{$entry->formatpostdate}
{$entry->titlelink} {$entry->morelink}
{else}
{$entry->formatpostdate}
{$entry->titlelink} {$entry->morelink}
{/if}
{if $smarty.foreach.dategroup.last}
{/if}
{/foreach}
You can actually see the result here... http://www.instoragereit.ca/pressroom
As they add releases, they will show automagically based on the month! Yippeee
Anyway, not the cleanest solution but it works for now!
Since I have each press release categorized by Year, Month I created this little template and essentially made 12 calls to each individual monthly category.
The Template looks like this...
{foreach name="dategroup" from=$items item=entry}
{if $smarty.foreach.dategroup.first}
{$entry->category}
{$entry->formatpostdate}
{$entry->titlelink} {$entry->morelink}
{else}
{$entry->formatpostdate}
{$entry->titlelink} {$entry->morelink}
{/if}
{if $smarty.foreach.dategroup.last}
{/if}
{/foreach}
You can actually see the result here... http://www.instoragereit.ca/pressroom
As they add releases, they will show automagically based on the month! Yippeee
Anyway, not the cleanest solution but it works for now!
Re: Smarty New Template Help
Came out real nice..... but...
The pressroom page has 131 errors not valid... http://validator.w3.org/check?verbose=1 ... essroom%2F
and the article itself... 86... http://validator.w3.org/check?verbose=1 ... F6%2F32%2F
The pressroom page has 131 errors not valid... http://validator.w3.org/check?verbose=1 ... essroom%2F
and the article itself... 86... http://validator.w3.org/check?verbose=1 ... F6%2F32%2F


