Help with my first theme..., a forum discussion on Jojo CMS. Join us for more discussions on Help with my first theme... on our Themes Support forum.
You must be logged in to post a reply
| |
I'm not sure if this is a Smarty issue or what...
I need the first page of my site to list the full text of the latest article and summaries for a limited number of prior articles (3-5).
Does anyone have suggestions for how to attack this particular issue?
Thanks a million!
I need the first page of my site to list the full text of the latest article and summaries for a limited number of prior articles (3-5).
Does anyone have suggestions for how to attack this particular issue?
Thanks a million!
Awesomeness for the heck of it...
your template should have something like this in it (the number of articles displayed is controlled through options):
{if $articles}
<div id='news' class="sidebarbox">
<h2>News</h2>
{foreach from=$articles key=key item=article}
{if $article.ar_image}<img src="images/v7000/articles/{$article.ar_image}" alt = "{$article.title}" class="right-image" style="clear: right"/>{/if}
<h3><a href='{$article.url}'>{$article.title}</a></h3>
<p class='news-content'>
{$article.bodyplain|truncate:156:"..."}
<a class='links' href='{$article.url}' title="{$article.title}">> Read more</a>
</p>
{/foreach}
<p class="links">> <a href='{$SITEURL}/{$articleshome}/'>See all stories</a></p>
</div>
{/if}
the trick is to use the $key to control the truncate - so instead of :
<p class='news-content'>
{$article.bodyplain|truncate:156:"..."}
<a class='links' href='{$article.url}' title="{$article.title}">> Read more</a>
</p>
use:
{if $key==0}
{$article.ar_body}
{else}
<p class='news-content'>
{$article.bodyplain|truncate:156:"..."}
<a class='links' href='{$article.url}' title="{$article.title}">> Read more</a>
</p>
{/if}
{if $articles}
<div id='news' class="sidebarbox">
<h2>News</h2>
{foreach from=$articles key=key item=article}
{if $article.ar_image}<img src="images/v7000/articles/{$article.ar_image}" alt = "{$article.title}" class="right-image" style="clear: right"/>{/if}
<h3><a href='{$article.url}'>{$article.title}</a></h3>
<p class='news-content'>
{$article.bodyplain|truncate:156:"..."}
<a class='links' href='{$article.url}' title="{$article.title}">> Read more</a>
</p>
{/foreach}
<p class="links">> <a href='{$SITEURL}/{$articleshome}/'>See all stories</a></p>
</div>
{/if}
the trick is to use the $key to control the truncate - so instead of :
<p class='news-content'>
{$article.bodyplain|truncate:156:"..."}
<a class='links' href='{$article.url}' title="{$article.title}">> Read more</a>
</p>
use:
{if $key==0}
{$article.ar_body}
{else}
<p class='news-content'>
{$article.bodyplain|truncate:156:"..."}
<a class='links' href='{$article.url}' title="{$article.title}">> Read more</a>
</p>
{/if}
Tom,
Thanks, that's lickity split!
Can I put that code in a content page created within JoJo? I'm hoping for this to be the front page of the site...
Thanks!
Thanks, that's lickity split!
Can I put that code in a content page created within JoJo? I'm hoping for this to be the front page of the site...
Thanks!
Awesomeness for the heck of it...
| Back to Forum Index : Back to Themes Support |
|
