News Module - details page only shows one article

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
irish
Forum Members
Forum Members
Posts: 101
Joined: Tue Jun 03, 2008 2:31 pm

News Module - details page only shows one article

Post 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?
Peciura

Re: News Module - details page only shows one article

Post by Peciura »

Can you post news detail template. Or PM temp admin login.
irish
Forum Members
Forum Members
Posts: 101
Joined: Tue Jun 03, 2008 2:31 pm

Re: News Module - details page only shows one article

Post by irish »

I have attached the template. The only thing I have on the page is this:

Code: Select all

 {news} 
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

Peciura

Re: News Module - details page only shows one article

Post 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.
irish
Forum Members
Forum Members
Posts: 101
Joined: Tue Jun 03, 2008 2:31 pm

Re: News Module - details page only shows one article

Post 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}
irish
Forum Members
Forum Members
Posts: 101
Joined: Tue Jun 03, 2008 2:31 pm

Re: News Module - details page only shows one article

Post 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?
Peciura

Re: News Module - details page only shows one article

Post 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
{fetch file="http://adikat.ie/index.php?page=news_browsecat&showtemplate=false&hl=$lang"}
Do not wory about ugly url - nobody will see that :)
Locked

Return to “[locked] CMSMS MLE fork”