Forums / Developer / Howto add content to ezFlow Blocks

Howto add content to ezFlow Blocks

Author Message

John Moritz

Tuesday 24 June 2008 11:08:26 am

I am using ezPublish 4 with ezFlow and want to integrate some custom modules into the Block System. I already made some module-extensions which I can access when I type in the Modulename into the Browsers address bar.

Now I want to know how I can add my modules into the content tree like here http://ez.no/doc/ez_publish/user_manual/4_0/daily_tasks/adding_content , because I see no other solution to put content to blocks. So far as I can see, its only possible to add content to blocks, when its available thru the content tree. I have not found a solution to add custom Modules to the content tree. My modules are, for example, like widgets (weather, who is online, newest member, etc). I want to show them on one page. At this time every custom module has its own Page.

I think the best way will be, to make my modules available thru the content Classgroups, where u can find the article, blog, forum or gallery classes. So maybe I have to convert my modules to content classes, but I have not found any information how I can do this. There are some infos I have found in the documentation http://ez.no/doc/ez_publish/technical_manual/4_0/concepts_and_basics/content_management/the_content_class , but not enough that I can understand it, and build my own content classes.

Can u guys explain in a short way, how I can make my own content class, or how I can add my custom scripts or modules to the ezFlow Blocks.

Łukasz Serwatka

Tuesday 24 June 2008 12:56:13 pm

Now I want to know how I can add my modules into the content tree like here http://ez.no/doc/ez_publish/user_manual/4_0/daily_tasks/adding_content , because I see no other solution to put content to blocks

This is one of the limitations concerning using custom modules directly in content tree. The workaround is to make a link (using link content class) which points the module view.

About eZ Flow, you can learn more from the manuals.
http://ez.no/doc/extensions/ez_flow

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

John Moritz

Wednesday 25 June 2008 8:51:10 am

Can u explain how i can do this please.
I know its very easy to link to my module. But then i dont see the content of my module, just a link. Thats not what i want to do.

For example, lets say i have written a little widget, which shows me the weather for the next three days. i made the extension which i called "myweather". Now i make a Frontpage with ezFlow Blocksystem and 2 Blocks. A big Block on the Left and a small on the right. Now i want to add the weather widget to the right block. So everybody can see how the weather is. Your solution just shows the link to the module, right?

Maybe i can use the link class, copy it, and make changes to the template, which will show my module directly and not the link?
It would be great if there is be a solution from the main developers, to include custom modules, or better widgets, to the content tree or directly to the ezFlow Block system. Another example ist the integration of widgets like last.fm or slide.com. At the moment it looks very difficult for me to do that the easy way.

I want to clarify that i can write my modules that everything fit my needs, but then i cannot use the excellent ezFlow options like timeshiftetc. I search a solution for implementing my custom things to ez with 100% integration. At the end, a editor should change things on the layout, and the editor have no idea of Webdevelopment.

Łukasz Serwatka

Wednesday 25 June 2008 2:06:12 pm

For example, lets say i have written a little widget, which shows me the weather for the next three days. i made the extension which i called "myweather". Now i make a Frontpage with ezFlow Blocksystem and 2 Blocks. A big Block on the Left and a small on the right. Now i want to add the weather widget to the right block. So everybody can see how the weather is. Your solution just shows the link to the module, right?

No, that is different approach. Link is useful when you want to hook-up to content tree. eZ Flow blocks is something totally different. If you need display in your block content from your view, you need to access it either view iframe in custom block (check manual) or call AJAX response and return the XHTML (or whatever you need) or create a template operator that returns content from your module view in template or write a GUI function (not trivial).

It would be great if there is be a solution from the main developers, to include custom modules, or better widgets, to the content tree or directly to the ezFlow Block system. Another example ist the integration of widgets like last.fm or slide.com. At the moment it looks very difficult for me to do that the easy way.

This is not difficult. eZ Flow has something called custom block which gives you freedom in creating it. It is just template where you can put everything you need. Nicolas Pastorino from French eZ Systems office had a presentation during eZ Publish Developer Day in Skien last week how to make a custom block which displays google maps for example. There was no PHP codding required. (I will check if his slides are available).

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

John Moritz

Friday 27 June 2008 5:55:38 am

Thanks a lot,
would be great to get more infos on custom blocks. That sounds good and is maybe exactly what i want.

A Costello

Wednesday 02 July 2008 1:56:58 pm

Did you ever find those slides? I am interested in viewing them as well.

Łukasz Serwatka

Wednesday 09 July 2008 11:08:46 pm

Hi,

Here you can download slides:
http://ez.no/content/download/238372/1614160/version/2/file/eZFlow_tutorial-developer_day.pdf

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Gary Teh

Wednesday 24 December 2008 2:02:14 am

Hi I took the slides and attempted at setting up the google map component. I skipped a few steps in them as I had no idea what they were talking about. These are the steps from the slides I skipped

1. Quick port to PHP5
2. Some customization ( datatype's view template ) :
3. support for 'type' parameter. Controls the size and/or type or the map
4. Create templates for your block's view :
5. override block/view/view.tpl

6. Available override conditions :
7. 'type' name of the configuration block from block.iniex : GMapsItem
8. 'view'picked from the available views for a given blockex : block.ini[GMapsItem].ViewList : gmaps_1item_large

9. // override block snippet
10 .[block_gmaps_1item_tiny]Source=block/view/view.tplMatchFile=block/gmaps_1item_tiny.tplSubdir=templatesMatch[type]=GMapsItemMatch[view]=gmaps_1item_tiny

The resultant output I got was a block displayed on the front page with the text <<Block: Google Maps item>>

Might it be possible if further explanations were given for these steps. Thanks

http://name1price.com : Get a Cool website for yourself and also learn how to manage it. It is easy. Use it to get more customers for your business.

eZ debug

Timing: Jan 18 2025 05:18:38
Script start
Timing: Jan 18 2025 05:18:38
Module start 'content'
Timing: Jan 18 2025 05:18:39
Module end 'content'
Timing: Jan 18 2025 05:18:39
Script end

Main resources:

Total runtime1.1096 sec
Peak memory usage4,096.0000 KB
Database Queries213

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 587.7344180.8281
Module start 'content' 0.00630.9143 768.5625693.0625
Module end 'content' 0.92060.1890 1,461.6250344.4297
Script end 1.1095  1,806.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.3798210.0002
Check MTime0.00160.1473210.0001
Mysql Total
Database connection0.00100.086510.0010
Mysqli_queries1.015891.54812130.0048
Looping result0.00240.21962110.0000
Template Total1.081797.520.5408
Template load0.00230.208820.0012
Template processing1.079497.273520.5397
Template load and register function0.00020.014010.0002
states
state_id_array0.00090.080710.0009
state_identifier_array0.00100.089720.0005
Override
Cache load0.00210.1879510.0000
Sytem overhead
Fetch class attribute can translate value0.00140.130150.0003
Fetch class attribute name0.00140.1287100.0001
XML
Image XML parsing0.00190.168650.0004
class_abstraction
Instantiating content class attribute0.00000.0021120.0000
General
dbfile0.00370.3346340.0001
String conversion0.00000.000330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 40
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs