Page 1 of 1

[SOLVED] Showing checkbox field definition in CGBlog

Posted: Thu May 28, 2015 1:11 am
by pwg
Hi, as always, appreciate any help.

I have added a public checkbox field to CGBlog.

If I print out all the variables, I can see the checkbox (labelled "sponsored" there.

How do I call it in the summary template?

I tried variations on
{if $sponsored =='1'}
{$entry->fields['sponsored']}
do this..
{/if}

but no go.
Again, any help appreciated.

Cheers,

Paul

Re: Showing checkbox field definition in CGBlog

Posted: Thu May 28, 2015 7:35 am
by velden
Not tested:

Code: Select all

{if $sponsored ==1}
(remove the quotes)

Re: Showing checkbox field definition in CGBlog

Posted: Thu May 28, 2015 11:11 am
by pwg
Many thanks as always Velden, but no go this time.

Still not happening.

Cheers,

Re: Showing checkbox field definition in CGBlog

Posted: Thu May 28, 2015 11:20 am
by velden
Sorry, what was I thinking?

Code: Select all

{if $entry->fields.sponsored->value  == 1}
  ...
{/if}

Re: Showing checkbox field definition in CGBlog

Posted: Thu May 28, 2015 1:11 pm
by pwg
Fantastic - thank you again Velden.

I'm looking at a lot of beer I owe you now.

Cheers,