Forums / Extensions / eZ Flow / Timeline and blocks

Timeline and blocks

Author Message

Anja Lundin

Monday 18 May 2009 7:07:06 am

Hi!
I've been working to solve a problem we have with the timeline for some time now and today I finally found out what the trouble is.

The problem was that every time we tried to use the timeline we got the javascript error:
YAHOO.util.Dom.get( blockID ).innerHTML is null

First of all, in the zone/ourzonetemplate.tpl I noticed that the

<div id="address-{$block.zone_id}-{$block.id}">

was removed, and it must not be removed if we want to use the timeline. The timeline uses the id of the div to recognise the blocks.

Second: we have a dynamic block which is shown sometimes and sometimes not. The timeline wanted to fetch the id for our dynamic block everytime, even if there was no content inside the block. I have now removed the if-statement around the div

{if or( $block.valid_nodes|count(), 
    and( is_set( $block.custom_attributes), $block.custom_attributes|count() ), 
    and( eq( ezini( $block.type, 'ManualAddingOfItems', 'block.ini' ), 'disabled' ), ezini_hasvariable( $block.type, 'FetchClass', 'block.ini' )|not ) )}
    <div id="address-{$block.zone_id}-{$block.id}">
    {block_view_gui block=$block}
    </div>
{else}
    {skip}
{/if}

and I put the code in the template without any if-statements.

My question now is: Can there be any unwanted consequences if we don't have the if-statement in the zone template? What is the idea of this if-statement?

Thanks in advance!

Anja Lundin, Novitell AB, Sweden

------------------------------------
Anja Lundin
Developer, Novitell AB
Sweden

www.novitell.se