I can't live without ez Ad

Author Message

scott bell

Wednesday 25 February 2004 12:28:37 pm

Hiya,

Looking at ex 3.3, there seems to be no way to incorporate adverts into news. It used to be easy with the old sections.

In 2,2,x it was

article..
article..
advert from this category
advert...

Am I right in saying this extremely useful feature is not possible?

Alex Jones

Wednesday 25 February 2004 1:40:46 pm

Actually, you should be able to replicate the pattern with the <i>delimiter</i> functionality of eZ 3. An example is available at http://ez.no/ez_publish/documentation/customization/custom_design/examples/common_template_issues/complex_list But, a quick (and untested) run-down would be something along the lines of:

{let name=Child children=fetch('content','tree',hash(parent_node_id,23,))}
  {section loop=$:children}
	[YOUR ARTICLE INCLUDE CODE]
    {delimiter modulo=3} [YOUR ADVERTISEMENT INCLUDE CODE] {/delimiter}
  {/section}
{/let}

The important part is <i>{delimiter modulo=3} [YOUR ADVERTISEMENT INCLUDE CODE] {/delimiter}</i> which will insert your advertisement on every third (in this case) iteration through the loop. So, you could tweak it to match the pattern you want it to follow.

More examples can be found at http://ez.no/ez_publish/documentation/development/libraries/ez_template/functions/section

Hope this helps,

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

scott bell

Thursday 26 February 2004 12:38:36 pm

Alex,

Just a note to say thanks. The worth of ez publish comes thru when you have a deeper knowledge, and these posts from people like you help us greatly.

Alex Jones

Thursday 26 February 2004 1:17:19 pm

You are quite welcome! eZ publish is a great tool, even though, or perhaps because it has a steep learning curve. This is a really good community that has taught me a lot, so I try to give back where I can. :)

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

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 18 2025 22:24:55
Script start
Timing: Jan 18 2025 22:24:55
Module start 'layout'
Timing: Jan 18 2025 22:24:55
Module start 'content'
Timing: Jan 18 2025 22:24:56
Module end 'content'
Timing: Jan 18 2025 22:24:56
Script end

Main resources:

Total runtime0.8559 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 589.0391152.6250
Module start 'layout' 0.00590.0030 741.664139.4453
Module start 'content' 0.00900.8453 781.1094544.6719
Module end 'content' 0.85430.0015 1,325.781312.1641
Script end 0.8559  1,337.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.4397160.0002
Check MTime0.00150.1754160.0001
Mysql Total
Database connection0.00080.090710.0008
Mysqli_queries0.800493.5163600.0133
Looping result0.00060.0667580.0000
Template Total0.823496.220.4117
Template load0.00210.250820.0011
Template processing0.821295.948420.4106
Template load and register function0.00020.028410.0002
states
state_id_array0.00140.169210.0014
state_identifier_array0.00160.189020.0008
Override
Cache load0.00180.2057260.0001
Sytem overhead
Fetch class attribute can translate value0.00070.078420.0003
Fetch class attribute name0.00190.217150.0004
XML
Image XML parsing0.00080.094820.0004
class_abstraction
Instantiating content class attribute0.00000.002060.0000
General
dbfile0.00100.1136160.0001
String conversion0.00000.001040.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/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: 16
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs