Page 1 of 1
News Module - details page only shows one article
Posted: Thu May 13, 2010 2:06 pm
by irish
Hi all,
I started a thread on the Product Support section and been advised that I really should go here.
News Module - details page only shows one article
http://forum.cmsmadesimple.org/index.ph ... 960.0.html
Can anyone advise on this?
Re: News Module - details page only shows one article
Posted: Thu May 13, 2010 2:38 pm
by Peciura
Can you post news detail template. Or PM temp admin login.
Re: News Module - details page only shows one article
Posted: Thu May 13, 2010 3:49 pm
by irish
I have attached the template. The only thing I have on the page is this:
Re: News Module - details page only shows one article
Posted: Thu May 13, 2010 11:24 pm
by Peciura
News detail template is here "Content » News > Detail Templates". I guess you have only one - "Sample" template. post all of them if you have more templates.
Re: News Module - details page only shows one article
Posted: Fri May 14, 2010 1:24 pm
by irish
Only have one: sample
Code: Select all
{* set a canonical variable that can be used in the head section if process_whole_template is false in the config.php *}
{if isset($entry->canonical)}
{assign var='canonical' value=$entry->canonical}
{/if}
<div class="newscats">
{news browsecat="0"}
{news browsecat="1"}
</div>
{if $entry->postdate}
<div id="NewsPostDetailDate">
{$entry->postdate|cms_date_format}
</div>
{/if}
<h3 id="NewsPostDetailTitle">{$entry->title|cms_escape:htmlall}</h3>
<hr id="NewsPostDetailHorizRule" />
{if $entry->summary}
<div id="NewsPostDetailSummary">
<strong>
{eval var=$entry->summary}
</strong>
</div>
{/if}
<div id="NewsPostDetailContent">
{eval var=$entry->content}
</div>
{if $entry->extra}
<div id="NewsPostDetailExtra">
{$extra_label} {$entry->extra}
</div>
{/if}
<div id="NewsPostDetailPrintLink">
{$entry->printlink}
</div>
{if $return_url != ""}
<div id="NewsPostDetailReturnLink">{$return_url}</div>
{/if}
{if isset($entry->fields)}
{foreach from=$entry->fields item='field'}
<div class="NewsDetailField">
{if $field->type == 'file'}
{* this template assumes that every file uploaded is an image of some sort, because News doesn't distinguish *}
<img src="{$entry->file_location}/{$field->value}"/>
{else}
{$field->name}: {eval var=$field->value}
{/if}
</div>
{/foreach}
{/if}
Re: News Module - details page only shows one article
Posted: Fri May 14, 2010 1:31 pm
by irish
hhmmmm, I just removed the
Code: Select all
<div class="newscats">
{news browsecat="0"}
{news browsecat="1"}
</div>
from that template and it works now. Is there a way to keep a list of articles on the details page?
Re: News Module - details page only shows one article
Posted: Fri May 14, 2010 3:19 pm
by Peciura
Try like this
Code: Select all
{assign var='temp_save_actionid' value=$actionid}
<div class="newscats">
{news browsecat="0"}
{news browsecat="1"}
</div>
{assign var='actionid' value=$temp_save_actionid}
If no luck - create new active, hidden page '
news_browsecat'
Code: Select all
{news browsecat="0"}
{news browsecat="1"}
and in news detail template add
Do not wory about ugly url - nobody will see that
