Page 1 of 1
a probably easy when you know how news question
Posted: Sat Nov 29, 2008 12:03 am
by macko
My news question is this - I have a link in the main menu at the top of my page called news. When I click this link my news articles are nicely ordered and laid out down the rhs of the page - using a summary template. This bit I fully understand.
However, when the "news" link from the main menu is clicked I would prefer for the most recent news article to appear in full detail in the {content} area, as though I had clicked .[..more] on the most recent summary article.
Does anyone know if this is possible - do I have to hack the link in the main menu?
many thanks
(cmsms 1.4.1)
Re: a probably easy when you know how news question
Posted: Sat Nov 29, 2008 12:12 am
by calguy1000
Yes, yes it is..... it's some simple smarty magic. I've done it. Not gonna tell you how.
the solution is left as an exersise to the user.
Re: a probably easy when you know how news question
Posted: Sat Nov 29, 2008 12:16 am
by macko
aaah no a challenge! my designer brain can't cope with php. I don't even know what "smarty" is yet but I'm on the case.
Re: a probably easy when you know how news question
Posted: Sat Nov 29, 2008 12:30 am
by calguy1000
actually, I kinda lied.
It is simple smarty logic... assuming you know where to look for a few things. and after a bit of reviewing
(i.e: making sure I wasn't just shooting my mouth off), I found that that not everything was documented.
Anyways.
On my news page here:
http://calguy1000.com/news.html The first news article is displayed in detail view. Because I use a bit of smarty magic and an undocumented feature of the news module.
Here's the exerpt out of my summary template:
Code: Select all
{foreach from=$items item=entry name='news'}
{if $smarty.foreach.news.index == 0}
{news action='detail' articleid=$news->id}
{else}
<div class="NewsSummary">
....
{/if}
{/foreach}
Now the rest is left for an exercise to the user.
Re: a probably easy when you know how news question
Posted: Sat Nov 29, 2008 12:36 am
by macko
great!
thanks for getting me started, I'll report back when the problem is solved.
cheers dude