Page 1 of 1

[solved] CGCalendar - display custom file field value is "0"

Posted: Fri Apr 23, 2010 10:48 pm
by curlypinky
CMSMS 1.7
CGCalendar 1.5.2

I have CGcalendar with 3 custom fields - Meet-Flyer (file), Meet-Results (file) and Location (text). I am trying to display the file field by calling it directly:
{$event.fields.Meet-Flyer} or {$event.fields.Meet-Results} however instead of displaying the filename it displays "0"

Using the default foreach cycle through all fields causes the filename to be displayed propertly:
{foreach from=$event.fields key='fieldname' item='fieldvalue'}
     {$fieldname}: {$fieldvalue}
{/foreach}
But for purposes of my template I really need to be able to call it directly. What is the proper format to display the value of a file field?
Thanks!
Alane

Re: CGCalendar - display custom file field value is "0"

Posted: Fri May 07, 2010 4:51 pm
by njprrogers
I'll second that emotion. Same CMSMS and CGcalendar versions.

Anybody got an answer for this one?

Re: CGCalendar - display custom file field value is "0"

Posted: Fri May 07, 2010 5:04 pm
by calguy1000
Read the smarty manual.

- is a math operator.

Re: CGCalendar - display custom file field value is "0"

Posted: Fri May 07, 2010 11:22 pm
by curlypinky
Ah I did not realize that. So Custom Fields names can only be alpha-numeric, no spaces no dashes. OK that works, thanks.
Alane

Re: [solved] CGCalendar - display custom file field value is "0"

Posted: Sat May 08, 2010 12:31 am
by calguy1000
No, I didn't say that... I said that - is a math operator.
There are ways around it.

Re: [solved] CGCalendar - display custom file field value is "0"

Posted: Sat May 08, 2010 1:17 am
by curlypinky
What is the proper way to reference a field that has spaces or reserved characters in its name? I've tried to find a solution but none of my attempts are correct.