eZ Community » Forums » Extensions » eZ Flow » Is ezflow working ?
expandshrink

Is ezflow working ?

Is ezflow working ?

Sunday 08 June 2008 7:45:39 pm - 4 replies

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 !

Monday 09 June 2008 1:01:00 pm

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

Modified on Monday 09 June 2008 1:43:43 pm by Bin LIU

Monday 09 June 2008 7:41:31 pm

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.

Modified on Monday 09 June 2008 7:42:22 pm by S├ębastien Antoniotti

Monday 09 June 2008 11: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

Tuesday 10 June 2008 10: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 Flowblunk.gif Emoticon

Modified on Tuesday 10 June 2008 10:34:43 pm by S├ębastien Antoniotti

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from