[SOLVED] Showing checkbox field definition in CGBlog

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
pwg
Forum Members
Forum Members
Posts: 191
Joined: Tue Aug 01, 2006 1:48 am

[SOLVED] Showing checkbox field definition in CGBlog

Post 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
Last edited by pwg on Thu May 28, 2015 1:12 pm, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Showing checkbox field definition in CGBlog

Post by velden »

Not tested:

Code: Select all

{if $sponsored ==1}
(remove the quotes)
pwg
Forum Members
Forum Members
Posts: 191
Joined: Tue Aug 01, 2006 1:48 am

Re: Showing checkbox field definition in CGBlog

Post by pwg »

Many thanks as always Velden, but no go this time.

Still not happening.

Cheers,
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Showing checkbox field definition in CGBlog

Post by velden »

Sorry, what was I thinking?

Code: Select all

{if $entry->fields.sponsored->value  == 1}
  ...
{/if}
pwg
Forum Members
Forum Members
Posts: 191
Joined: Tue Aug 01, 2006 1:48 am

Re: Showing checkbox field definition in CGBlog

Post by pwg »

Fantastic - thank you again Velden.

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

Cheers,
Post Reply

Return to “Modules/Add-Ons”