Page 1 of 1

CGCalendar display value of custom field?

Posted: Wed Aug 30, 2017 7:15 am
by rbaby
When I do {$event.fields.fieldvaluehere} I just get "Array", how do I get it to output the custom field value?

Thank you.

Re: CGCalendar display value of custom field?

Posted: Wed Aug 30, 2017 12:50 pm
by velden
Probably it's somewhere in the sample templates:

My guess (didn't check)
{$event.fields.fieldNAME.value}

It's not very difficult to find it yourself btw

Code: Select all

<pre>
  {$event.fields|print_r}
</pre>

Re: CGCalendar display value of custom field?

Posted: Wed Aug 30, 2017 3:21 pm
by rbaby
velden wrote:Probably it's somewhere in the sample templates:

My guess (didn't check)
{$event.fields.fieldNAME.value}

It's not very difficult to find it yourself btw

Code: Select all

<pre>
  {$event.fields|print_r}
</pre>
Thanks Velden. It did have it in the template, there was an example to loop through, and it did say to use {$event.fields.name}. It did not work for me and I also tried {$event.fields.name.value} which also did not work.

I know I ask a lot of questions...I do try to find the answer myself first! Mostly successful at doing so, largely not sometimes lol...

Re: CGCalendar display value of custom field?

Posted: Wed Aug 30, 2017 5:52 pm
by rbaby
For reference, this is what my template looks like:

Code: Select all

{if $event.fields.Venue !=""}
<h3>display {$event.fields.Venue.value}</h3>
{/if}
I'm calling it in the Event Display Template and it outputs nothing. I've placed: <pre>{$event.fields|print_r}</pre> and see the value correct so I'm not sure what I am doing wrong

Code: Select all

Array
(
    [Link] => Array
        (
            [field_name] => Link
            [field_type] => 0
            [field_searchable] => 1
            [field_extra] => Array
                (
                    [searchable] => 1
                    [wysiwyg] => 0
                    [ddopts] => 
                )

            [field_order] => 2
            [event_id] => 2
            [field_value] => http://testlink.co.uk
            [raw_value] => http://testlink.co.uk
        )

    [Venue] => Array
        (
            [field_name] => Venue
            [field_type] => 0
            [field_searchable] => 1
            [field_extra] => Array
                (
                    [searchable] => 1
                    [wysiwyg] => 0
                    [ddopts] => 
                )

            [field_order] => 0
            [event_id] => 2
            [field_value] => New Jersey
            [raw_value] => New Jersey
        )

)
1

Re: CGCalendar display value of custom field?

Posted: Wed Aug 30, 2017 7:00 pm
by rbaby
Figured it out, {$event.fields.Venue.field_value} worked