[solved] One (summary) news on each page

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Badyl

[solved] One (summary) news on each page

Post by Badyl »

Hello

I think what can I do, to get one news (the newest news) on each page.

I tried to mixed which the news template - summary and detail, and nothing.

To summary template I added code from detail template

Code: Select all

{if $entry->summary}
	<div id="NewsPostDetailSummary">
		<strong>
			{eval var=$entry->summary}
		</strong>
	</div>
{/if}
Have You any sollution for this :) ?
Last edited by Badyl on Thu Nov 15, 2007 11:09 am, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: One (summary) news on each page

Post by RonnyK »

Why don't you call {news number='1'} from within your template. That way you have a single entry on every page opened, as it is part of the template.

Ronny
Badyl

Re: One (summary) news on each page

Post by Badyl »

Yes but then i have been short news with link to full version of this news

And i want to display only the full version of news directly on page.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: One (summary) news on each page

Post by RonnyK »

What happens if you create a summary-template, where the part in RED is deleted....
{if $entry->summary}

{eval var=$entry->summary}



[{$entry->morelink}]


{else
if $entry->content}


{eval var=$entry->content}

{/if}
Ronny
Badyl

Re: One (summary) news on each page

Post by Badyl »

I have a blank page if i copy to summary template Your's code (without the Red part)

and get

Code: Select all

{news number='1' category="Kryminalki" summarytemplate="template2"}
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: One (summary) news on each page

Post by RonnyK »

Works over here,

http://demo.krijt.eu/index.php?page=nnn

I'll post my template:

{foreach from=$items item=entry}


{if $entry->formatpostdate}

{$entry->formatpostdate}

{/if}


{$entry->titlelink}



{$category_label} {$entry->category}


{if $entry->author}

{$author_label} {$entry->author}

{/if}

{if $entry->content}


{eval var=$entry->content}

{/if}

{if isset($entry->extra)}
   
        {eval var=$entry->extra}
{* {cms_module module='Uploads' mode='simpleurl' upload_id=$entry->extravalue} *}
   
{/if}
{if isset($entry->fields)}
  {foreach from=$entry->fields item='field'}
   
        {if $field->type == 'file'}
          file_location}/{$field->value}/>
        {else}
          {$field->name}: {eval var=$field->value}
        {/if}
   
  {/foreach}
{/if}


{/foreach}

with calling:
{news summarytemplate="check" number="1"}
Ronny
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: One (summary) news on each page

Post by RonnyK »

When you dont want to show the author and category, you can delete:

  {$category_label} {$entry->category}


{if $entry->author}
 
      {$author_label} {$entry->author}
 
{/if}
from the template.

Changing

  {$entry->titlelink}
to

  {$entry->title}
makes no LINK to dive into the entry, otherwise people can dive into ....

Ronny
Badyl

Re: One (summary) news on each page

Post by Badyl »

Thanx :) work's fine

This template might be enclose to standard templates of CMS MS

Thanx RonnyK, you helped me not first time :)
Locked

Return to “CMSMS Core”