Is ezflow working ?

Is ezflow working ?

Sunday 08 June 2008 10:45:39 am - 4 replies

Author Message

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

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

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