Forums / Setup & design / fetch content if checkbox is checked

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

fetch content if checkbox is checked

Author Message

Daniele Nocentini

Thursday 24 March 2005 6:25:36 am

I've a custom class called "banner", this class allows to publish a image as a banner, in this class I make checkbox attribute for active or inactive the banner.
How can I fetch the content if this attribute's class is checked?

my code is this:


{let randomised_array=fetch('content','tree', hash('parent_node_id', '223',
						class_filter_type, "include", class_filter_array, array(31)))|shuffle}
{section name=random loop=$randomised_array max=1}
<img src={$random:item.object.data_map.banner.content[original].full_path|ezroot} border="0">
{/section}
{/let}	

Antica Bottega Digitale srl
http://www.abd.it

Łukasz Serwatka

Thursday 24 March 2005 11:59:33 am

Hi Daniele,

You have to add

attribute_filter, array( array( 'news/show_in_news', '=', '1' ) )

where in this example "news" is class name and "show_in_news" is checkbox data type. 1 if checked or 0 if unchecked

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Daniele Nocentini

Friday 25 March 2005 12:30:48 am

Thanks Lukasz, great tips, work fine!!!

Antica Bottega Digitale srl
http://www.abd.it