• 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




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 
Author Message
 Post subject: [fixed?] News summary template {if} statement not working
PostPosted: Mon Jul 09, 2012 12:39 pm 
Offline
Power Poster
Power Poster

Joined: Wed Jul 04, 2007 3:39 pm
Posts: 315
This is in the release package of BETA 3. Works ok on BETA 2 but not now. The Do something would show if a file type field called Image does not have anything set.

Code:
{if isset($entry->fields.Image) && $entry->fields.Image->value != ''}Do something{/if}


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News summary template {if} statement not working
PostPosted: Fri Jul 13, 2012 9:34 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Tue Aug 12, 2008 9:30 pm
Posts: 2071
Location: Feldkirchen in Kärnten, Austria
Code:
<strong>{if isset($entry->fields.Test)}Field test: {$entry->fields.Test->value}{/if}</strong>


Works for me just fine rev 8174

_________________
CMSMS Blog - I do this!
Forge profile
Github profile
Twitter
=============================================
Support CMSMS


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News summary template {if} statement not working
PostPosted: Sun Jul 22, 2012 7:35 am 
Offline
Power Poster
Power Poster

Joined: Thu Mar 01, 2007 9:44 am
Posts: 253
Location: Belgique
If a file type field called Image does not have anything set, it return the id of the field in the detail template (work in the summary template), so I use now :
Code:
{foreach from=$entry->fields item='field'}
 {if $field->name == 'image' && $field->value neq '1'}


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News summary template {if} statement not working
PostPosted: Sun Jul 22, 2012 4:22 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8099
Location: Fernie British Columbia, Canada
Standard template issue works fine for me.

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News summary template {if} statement not working
PostPosted: Sun Jul 22, 2012 7:07 pm 
Offline
Power Poster
Power Poster

Joined: Thu Mar 01, 2007 9:44 am
Posts: 253
Location: Belgique
Yes, it works if you have only 1 field.
Put 2 custom text fields (first = image), let the first empty and put a valor into second.
If you put
Code:
{$field->name}:&nbsp;{eval var=$field->value}
<strong>{if isset($entry->fields.image)}Field test: {$entry->fields.image->value}{/if}</strong>

{$entry->fields.image->value} return : 1 (his id) and your condition don't work.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News summary template {if} statement not working
PostPosted: Mon Jul 23, 2012 12:39 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Sat Feb 27, 2010 2:37 pm
Posts: 193
Location: Finland
Fixed, thanks for reporting.

-Stikki-


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: [fixed?] News summary template {if} statement not workin
PostPosted: Tue Jul 24, 2012 4:57 pm 
Offline
Power Poster
Power Poster

Joined: Thu Mar 01, 2007 9:44 am
Posts: 253
Location: Belgique
Not fixed in 8193 detail template


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: [fixed?] News summary template {if} statement not workin
PostPosted: Tue Jul 24, 2012 5:08 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Sat Feb 27, 2010 2:37 pm
Posts: 193
Location: Finland
Works with revision 8196.

At least for me. test again.

-Stikki-


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: [fixed?] News summary template {if} statement not workin
PostPosted: Tue Jul 24, 2012 5:16 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8099
Location: Fernie British Columbia, Canada
I just tested... and made a minor adjustment.

Summary view now works exactly the same way as detail view wrt custom fields.

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: [fixed?] News summary template {if} statement not workin
PostPosted: Tue Jul 24, 2012 5:57 pm 
Offline
Power Poster
Power Poster

Joined: Thu Mar 01, 2007 9:44 am
Posts: 253
Location: Belgique
Ok, with a new install 8198, the id of the empty field don't more appear :)
But, you cannot use this condition for test if a field is empty <strong>{if isset($entry->fields.fieldname)}This appear only if image is not empty{/if}</strong>

You must now use <strong>{if isset($entry->fields.image->value)}This appear only if image is not empty{/if}</strong>
The condition code from uniq3 don't work.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: [fixed?] News summary template {if} statement not workin
PostPosted: Tue Jul 24, 2012 6:06 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Sat Feb 27, 2010 2:37 pm
Posts: 193
Location: Finland
As far as i know, you never could.

As field always exists if it's there, if it has value or not is other case.

-Stikki-


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: [fixed?] News summary template {if} statement not workin
PostPosted: Tue Jul 24, 2012 6:16 pm 
Offline
Power Poster
Power Poster

Joined: Thu Mar 01, 2007 9:44 am
Posts: 253
Location: Belgique
You're right. It's fixed for mee too.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 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:  
cron
A2 Hosting