[fixed?] News summary template {if} statement not working

A place to discuss issues related to CMSMS 1.11 beta versions. This forum will be heavily moderated.
Locked
cb2004
Power Poster
Power Poster
Posts: 315
Joined: Wed Jul 04, 2007 3:39 pm

[fixed?] News summary template {if} statement not working

Post by cb2004 »

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: Select all

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

Re: News summary template {if} statement not working

Post by uniqu3 »

Code: Select all

<strong>{if isset($entry->fields.Test)}Field test: {$entry->fields.Test->value}{/if}</strong>
Works for me just fine rev 8174
Jean le Chauve

Re: News summary template {if} statement not working

Post by Jean le Chauve »

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: Select all

{foreach from=$entry->fields item='field'}
 {if $field->name == 'image' && $field->value neq '1'}
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: News summary template {if} statement not working

Post by calguy1000 »

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.
Jean le Chauve

Re: News summary template {if} statement not working

Post by Jean le Chauve »

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: Select all

{$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.
Stikki

Re: News summary template {if} statement not working

Post by Stikki »

Fixed, thanks for reporting.

-Stikki-
Jean le Chauve

Re: [fixed?] News summary template {if} statement not workin

Post by Jean le Chauve »

Not fixed in 8193 detail template
Stikki

Re: [fixed?] News summary template {if} statement not workin

Post by Stikki »

Works with revision 8196.

At least for me. test again.

-Stikki-
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: [fixed?] News summary template {if} statement not workin

Post by calguy1000 »

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.
Jean le Chauve

Re: [fixed?] News summary template {if} statement not workin

Post by Jean le Chauve »

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.
Stikki

Re: [fixed?] News summary template {if} statement not workin

Post by Stikki »

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-
Jean le Chauve

Re: [fixed?] News summary template {if} statement not workin

Post by Jean le Chauve »

You're right. It's fixed for mee too.
Locked

Return to “[locked] CMSMS 1.11 Beta”