Forums / General / ezPublish disable layout

ezPublish disable layout

Author Message

Ivan Švogor

Monday 07 March 2011 8:17:57 am

Hi,

I need to display some custom xml when user clicks on some link. No templates, no html, just XML. Something like rss... everything I need is in php, i just need to echo it.. Can anyone tell me how can this be done in ez publish? thanks

Damien Pobel

Monday 07 March 2011 8:35:42 am

Hi Ivan,

you can write a module with a view that will output your XML. See this tutorial http://share.ez.no/learn/ez-publish/an-introduction-to-developing-ez-publish-extensions and especially the chapter on Creating a view

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Conrad Decker

Monday 07 March 2011 8:53:43 am

This won't help if everything you need is in PHP, but you can accomplish something similar using the layout module. You can create an alternate pagelayout file for each layout you create. For example, we've created an xml layout for exactly this reason. Take a look here: http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Modules/layout, it might provide some insight.

Marko Žmak

Monday 07 March 2011 12:09:00 pm

Ivan, I suggest to take a look at Conrad's advice.

A lot of things can be implemented using layouts and templates, and it gives you all the strength of the eZP template mechanism. For example, you can implement the complete RSS functionality.

You can even set the ContentType for a specific layout, it goes like this:

[json]
PageLayout=pagelayout_json.tpl
ContentType=application/json

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Jurica Perić

Wednesday 23 March 2011 6:49:35 am

In my opinion the simplest way is to create new extension (or expand an existing one) and add new view. In php script of that view run all the php code you need, echo it and on the end of file add following lines:

echo $output;
eZDB::checkTransactionCounter();
eZExecution::cleanExit();

Hope new FOI pages will work with this :)

Marko Žmak

Wednesday 23 March 2011 7:22:08 am

"

In my opinion the simplest way is to create new extension (or expand an existing one) and add new view. In php script of that view run all the php code you need, echo it and on the end of file add following lines:

echo $output;
eZDB::checkTransactionCounter();
eZExecution::cleanExit();

Hope new FOI pages will work with this :)

"

Using layouts is far more easier and simpler than creating a whole new extension.

Also you won't have any compatibility problems when upgrading as you could have with a custom extension.

Furthermore, writing a custom extension is a new source of bugs and stability and security issues, while using the layout system and eZ templates is an implementation that lies on a thoroughly tested eZP PHP code.

So if you don't need any special functionality that's not supported by the eZP template system I think that the layout solution is the best way to do it.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Jurica Perić

Saturday 26 March 2011 3:01:41 am

You're missing one key word. He says everything is in php. So he can't just echo php in template. Yes, layouts are simpler and faster way if you have everything you need in template variables. But that's not the case here. And if he doesn't know about the functionality i was talking about, i doubt that he knows how to get something from php in tpl.

eZ debug

Timing: Jan 17 2025 23:59:15
Script start
Timing: Jan 17 2025 23:59:15
Module start 'content'
Timing: Jan 17 2025 23:59:16
Module end 'content'
Timing: Jan 17 2025 23:59:16
Script end

Main resources:

Total runtime0.8468 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.0066 588.8203180.8516
Module start 'content' 0.00660.6949 769.6719714.0234
Module end 'content' 0.70150.1453 1,483.6953340.4609
Script end 0.8468  1,824.1563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.5133210.0002
Check MTime0.00150.1797210.0001
Mysql Total
Database connection0.00060.069710.0006
Mysqli_queries0.753789.00382130.0035
Looping result0.00250.30042110.0000
Template Total0.820796.920.4104
Template load0.00210.250220.0011
Template processing0.818696.666720.4093
Template load and register function0.00020.025210.0002
states
state_id_array0.00030.038410.0003
state_identifier_array0.00090.101120.0004
Override
Cache load0.00180.2170410.0000
Sytem overhead
Fetch class attribute can translate value0.00150.182860.0003
Fetch class attribute name0.00140.1695100.0001
XML
Image XML parsing0.00230.270560.0004
class_abstraction
Instantiating content class attribute0.00000.0026110.0000
General
dbfile0.00420.4950410.0001
String conversion0.00000.000730.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
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/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
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 9

Time used to render debug report: 0.0002 secs