Share » Forums » Extensions » eZ Flow » why ? and how ?

why ? and how ?

why ? and how ?

Saturday 21 August 2010 8:24:31 am - 3 replies

Modified on Saturday 21 August 2010 8:26:17 am by *- pike

Author Message

Thiago Campos Viana

Saturday 21 August 2010 6:54:16 pm

Hi pike

Reading your case I realized that you will have to customize ez flow.

You can change extension/ezflow/design/ezflow/override/templates/edit/frontpage.tpl and add an if statement like "if user is in group x then x can edit it..." or "if user is in group y then x can add blocks..."

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

*- pike

Monday 23 August 2010 12:59:50 pm

Thanks for your response.

Indeed, maybe I'm not using ezflow as it was intended. I was thinking .. all I really want is the block's functionality. How hard would it be to write a eZFlowBlock datatype, that represents one block as an attribute ? Using the code already in the ezflow extension, the same design, the same ezm_block and ezm_pool tables, using the same cron job, but just as a separate datatype ? eZFlowBlock already is a PersistentObject ..

Hm......

*-pike

---------------
The class eZContentObjectTreeNode does.

Gaetano Giunta

Tuesday 24 August 2010 1:27:00 am

Mmm, many different things on this post:

  • being able to prevent editors from adding/removing blocks: would be nice, add a feat. request. You could maybe obtain that result via a custom workflow event
  • being able to prevent editors from switching layouts: just define in zone.ini that your frontpage class has only one layout available for it. Being able to specify it by node can be done by using one different fp class per node, which is doable albeit a chore if you have too many fp objects
  • being able to specify which blocks can be added to which zones: would be nice, add a feat. request

And then the last one: being able to use ezflow block code in a simplified "object/attribute" way.

Before ezflow was released, having 'blocks' which linked to content was a common requirement, and it was often implemented with schemas such as the following:

  1. frontpage obj has one (or more) obj-relations attribute that links to block objects
  2. block objects live in a separate content section
  3. block objects are linked to the content they display via aon obj relation attribute (manual block), or have custom templates that do whatever they need (auto/custom block). This means having a couple of different "block" classes with different template override rules
  4. this can be augmented with grouping block objects into "column" containers. Then many fp objects can link to the same 'column'. If the column is displayed on the side of the web page (ie. outside actual content area), the node tpl for fp passes its related column id to the pagelayout tpl via the persistent variable, and the pagelayout tpl is in charge of fetching the column and displaying it. If the column for a node is undefined, the column of its parent is used etc...

This is all fine and dandy. What you miss is the ajax-based 'add node to block' interface, possibly some fine-grained policy on what obj classes to be able to add to obj-relation attributes, timeline preview and of course the "queueing" of content.

Back on topic: if you want to use the templates of custom blocks (that do everything in the template) in your own code, it's going to be pretty easy. Create an obj with an attribute to store eg. the rss feed url or twitter id, and include the desired block template passing those values to it.

Good luck trying to extract a single existing 'zone' or 'block' to put it in an external datatype though - I fear that besides rewriting code that reads stuff from ezm_block and ezm_pool, you will break the existing logic - most of which is coded in ezflowoperations.php, and is brittle and convoluted at times...

Principal Consultant International Business
Member of the Community Project Board

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

36 542 Users on board!

Forums menu