• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Problema {if} {/if} su modello News
PostPosted: Wed Jul 02, 2008 9:10 am 
Offline
Forum Members
Forum Members

Joined: Mon Jan 28, 2008 8:30 am
Posts: 29
Ciao ragazzi.

Sul sito che sto sviluppando, devo fare in modo che sulla pagina che mi visualizza una news, appaia una scritta tipo "Nessuna articolo presente" quando non ci sono notizie per la categoria relativa.

Prendendo ad esempio il modello di sommario di esempio:
Code:
<!-- Start News Display Template -->
{if $pagecount > 1}
  <p>
{if $pagenumber > 1}
{$firstpage} {$prevpage} 
{/if}
{$pagetext} {$pagenumber} {$oftext} {$pagecount}
{if $pagenumber < $pagecount}
 {$nextpage} {$lastpage}
{/if}
</p>
{/if}
{foreach from=$items item=entry}
<div class="NewsSummary">

{if $entry->formatpostdate}
   <div class="NewsSummaryPostdate">
      {$entry->formatpostdate}
   </div>
{/if}

<div class="NewsSummaryLink">
   {$entry->titlelink}
</div>

<div class="NewsSummaryCategory">
   {$category_label} {$entry->category}
</div>

{if $entry->author}
   <div class="NewsSummaryAuthor">
      {$author_label} {$entry->author}
   </div>
{/if}

{if $entry->summary}
   <div class="NewsSummarySummary">
      {eval var=$entry->summary}
   </div>

   <div class="NewsSummaryMorelink">
      [{$entry->morelink}]
   </div>

{else if $entry->content}

   <div class="NewsSummaryContent">
      {eval var=$entry->content}
   </div>
{/if}

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

</div>
{/foreach}
<!-- End News Display Template -->


ecco, non so dove andare ad inserire la chiamata e quale sintassi usare  ???

Ho provato ad inserire, prima di foreach
{if $items > 0}
{foreach from=$items item=entry}
bla bla bla...
{/foreach}
{else}
Nessuna articolo presente
{/if}


ma non funziona! Dov'è che sbaglio?!?  >:(

1dMN


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Problema {if} {/if} su modello News
PostPosted: Wed Jul 02, 2008 10:54 am 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4809
Location: Ferrara, Italy
1dMN wrote:
Ho provato ad inserire, prima di foreach
{if $items > 0}
{foreach from=$items item=entry}
bla bla bla...
{/foreach}
{else}
Nessuna articolo presente
{/if}


ma non funziona! Dov'è che sbaglio?!?  >:(


Forse:

{if $itemcount > 0}
{foreach from=$items item=entry}
bla bla bla...
{/foreach}
{else}
Nessuna articolo presente
{/if}


Alby

_________________
Former Italian Admin and Moderator
Multilingual: MLE is not CMSMS


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Problema {if} {/if} su modello News
PostPosted: Wed Jul 02, 2008 12:18 pm 
Offline
Forum Members
Forum Members

Joined: Mon Jan 28, 2008 8:30 am
Posts: 29
alby wrote:
1dMN wrote:
Ho provato ad inserire, prima di foreach
{if $items > 0}
{foreach from=$items item=entry}
bla bla bla...
{/foreach}
{else}
Nessuna articolo presente
{/if}


ma non funziona! Dov'è che sbaglio?!?  >:(


Forse:

{if $itemcount > 0}
{foreach from=$items item=entry}
bla bla bla...
{/foreach}
{else}
Nessuna articolo presente
{/if}


Alby


Aarghh!!! Quanto sono studido  :o

Grazie Alby.
1dMN


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Hosting Nation - Managed CMSMS Hosting