Forums / General / I can't live without ez Ad

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>