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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 06:08:11
Script start
Timing: Jan 19 2025 06:08:11
Module start 'layout'
Timing: Jan 19 2025 06:08:11
Module start 'content'
Timing: Jan 19 2025 06:08:12
Module end 'content'
Timing: Jan 19 2025 06:08:12
Script end

Main resources:

Total runtime0.7877 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.2734152.6406
Module start 'layout' 0.00510.0026 741.914139.4766
Module start 'content' 0.00770.7785 781.3906543.2734
Module end 'content' 0.78620.0014 1,324.664112.1406
Script end 0.7876  1,336.8047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3890160.0002
Check MTime0.00130.1588160.0001
Mysql Total
Database connection0.00060.074010.0006
Mysqli_queries0.742094.1995570.0130
Looping result0.00050.0617550.0000
Template Total0.759396.420.3796
Template load0.00190.238920.0009
Template processing0.757496.156920.3787
Template load and register function0.00010.013410.0001
states
state_id_array0.00090.113810.0009
state_identifier_array0.00130.159320.0006
Override
Cache load0.00150.1895170.0001
Sytem overhead
Fetch class attribute can translate value0.00080.095620.0004
Fetch class attribute name0.00170.214550.0003
XML
Image XML parsing0.00100.121320.0005
class_abstraction
Instantiating content class attribute0.00000.001660.0000
General
dbfile0.00140.1714240.0001
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs