Is ezflow working ?

Author Message

Sébastien Antoniotti

Sunday 08 June 2008 10:45:39 am

Hi,

After a complete day to try to make works eZ Flow, I'm asking me if eZ Flow is complete !

I just want to use overflow rules between two dynamic blocs who will display the same content (articles).

The first block will have 4 items visibles, and the second block will display 10 item. So I would like the first block to display articles 1 to 4, and the second block to display articles 5 to 14.

So I have defined my blocks like this :

[block2]
Name=block2
NumberOfValidItems=10
NumberOfArchivedItems=0
ManualAddingOfItems=disabled
FetchClass=fetcharticles
FetchParameters[]
FetchParameters[Source]=nodeID
FetchParameters[Class]=Class
# Single / Multiple
FetchParametersSelectionType[Source]=single
FetchParametersSelectionType[Class]=multiple
FetchParametersIsRequired[]
# True / False
FetchParametersIsRequired[Source]=true
FetchParametersIsRequired[Class]=true
ViewList[]=vue_liste
ViewName[vue_liste]=Vue liste


[block1]
Name=block1
NumberOfValidItems=4
NumberOfArchivedItems=0
ManualAddingOfItems=disabled
FetchClass=fetcharticles
FetchParameters[]
FetchParameters[Source]=nodeID
FetchParameters[Class]=Class
# Single / Multiple
FetchParametersSelectionType[Source]=single
FetchParametersSelectionType[Class]=multiple
FetchParametersIsRequired[]
# True / False
FetchParametersIsRequired[Source]=true
FetchParametersIsRequired[Class]=true
ViewList[]=vue_liste
ViewName[vue_liste]=Vue liste

The fetcharticles class returns the articles ordered by publication date DESC, without limit.

Then, I added the two blocks into my zone, set the parameters and selected block2 into the overflow dropdown of the block1.

But I have the same content into the blocks, even if I run the ezflow cronjob...

I'm going to became crazy with eZ Flow =(

Thanks in advance for your help !

eZ Publish Freelance
web : http://www.webaxis.fr

Bin LIU

Monday 09 June 2008 4:01:00 am

Hi,

I think you can fetch 14 article in the first block with NumberOfValidItems 4, and then, the reste 10 article will auto added into the second block.
In this case, you must create a FetchClass with .
Like this :

[block1]
Name=block1
NumberOfValidItems=4
NumberOfArchivedItems=0
ManualAddingOfItems=disabled
FetchClass=fetcharticles
FetchFixedParameters[]
FetchFixedParameters[Class]=article
FetchParameters[]
FetchParameters[Source]=nodeID
FetchParameters[Depth]=2
#this return 14 articles, so 10 article will added into the block 2 !!!!!!!!!!!!!!!!!!!!!!!!!
FetchParameters[Limit]=14
FetchParametersSelectionType[Source]=single
FetchParametersIsRequired[]
FetchParametersIsRequired[Source]=true
FetchParametersIsRequired[Depth]=true
FetchParametersIsRequired[Limit]=true
ViewList[]=ttt
ViewName[ttt]=tttttt
#Time for change the block after the crontab ezflow passed.
TTL=1800

Good luck

=== Lagardère Active ===

Fetch random
http://projects.ez.no/la_fetch_random
LA Static Cache
http://projects.ez.no/lastaticcache
LA Bookmarks (jquery)
http://projects.ez.no/labookmark
LA Calendar (jquery)
http://projects.ez.no/lacalendar

My site ez
http://lingping.info

Sébastien Antoniotti

Monday 09 June 2008 10:41:31 am

Hi Bin,

Thanks a lot for your help, I've tried your solution but it doesn't works.

Using your solution, did I still have to declare the block 2 like into my precedent post or I need to change something also into his declaration ?

Cheers,
Seb.

eZ Publish Freelance
web : http://www.webaxis.fr

Bin LIU

Monday 09 June 2008 2:21:34 pm

yes, you should create the second block empty, by example block manual with NumberOfValidItems=10. and config the first block overflow the second

your fetch class should be something like this :

class fetcharticles extends eZFlowFetchInterface
{
    function fetch( $parameters, $publishedAfter, $publishedBeforeOrAt )
    {
        if ( isset( $parameters['Source'] ) )
        {
            $nodeID = $parameters['Source'];
            $node = eZContentObjectTreeNode::fetch( $nodeID, false, false ); // not as an object
        }
        else
        {
            $nodeID = 0;
        }

        $subTreeParameters = array();
        $subTreeParameters['AsObject'] = false;
        $subTreeParameters['SortBy'] = array( 'published', true );

        /****************this is the last 14 article****************/
        $subTreeParameters['Limit'] = isset( $parameters['Limit'] ) ? $parameters['Limit']:false;
        $subTreeParameters['Depth'] = isset( $parameters['Depth'] ) ? $parameters['Depth']:false;

        if ( isset( $parameters['Class'] ) )
        {
            $subTreeParameters['ClassFilterType'] = 'include';
            $subTreeParameters['ClassFilterArray'] = explode( ';', $parameters['Class'] );
        }

       $result = eZContentObjectTreeNode::subTreeByNodeID( $subTreeParameters, $nodeID );
        $fetchResult = array();
        foreach( $result as $item )
        {
            $fetchResult[] = array( 'object_id' => $item['contentobject_id'],
                                    'node_id' => $item['node_id'],
                                    'ts_publication' => $item['published'] );
        }

        return $fetchResult;
    }
}

I wish it works for you

=== Lagardère Active ===

Fetch random
http://projects.ez.no/la_fetch_random
LA Static Cache
http://projects.ez.no/lastaticcache
LA Bookmarks (jquery)
http://projects.ez.no/labookmark
LA Calendar (jquery)
http://projects.ez.no/lacalendar

My site ez
http://lingping.info

Sébastien Antoniotti

Tuesday 10 June 2008 1:26:39 pm

It works!

Thank you very much for your help, I was really blocked!

With your advice and the latest version of svn extension, everything is back in order.

All apologies to the developers team for having doubted eZ Flow;)

eZ Publish Freelance
web : http://www.webaxis.fr

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