New site designs as an Extension

Author Message

Davide Garzetti

Thursday 12 March 2009 4:28:31 am

I read that some people to customize EzPublish site designs create an Extension insted of subdirectory in Design folder as EzPublish manual suggests.

Are there any advantages in some specific area ( es. performance) ?

Thank you for you comments.

Jean-Yves Zinsou

Thursday 12 March 2009 4:37:20 am

Hi there,

my reason for creating an extension, is that it can be moved around easily and that it is very simple to upgrade your ezpublish install !!

Do Androids Dream of Electric Sheep?
I dream of eZpubliSheep....
------------------------------------------------------------------------
http://www.alma.fr

André R.

Thursday 12 March 2009 5:00:09 am

Same here, makes it easier to upgrade, and usually there are some settings or even some more stuff that goes together with the design, so it really makes sense to use extensions for this. It also lets you override a specific design, so you can for instance place a design in you extensions called standard so that the templates override the default ones everywhere* (even admin), unless the template is defined in another design / extension with higher priority of course.

Doing everything in extensions became best practice internally in eZ back in 2005, so that's why ezwebin / ezflow are implemented like this as well.

* the concept I'm talking about here is placement overriding, no need for any override.ini rules, only place the file at the same location in a design/extension with higher priority (as defined by your SiteDesign, AdditionalSiteDesignList and ActiveExtensions settings).
override.ini overrides best for conditional overrides ("use this template on node id 55").

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Noicokuna Niemoge

Thursday 12 March 2009 5:47:46 am

Are there any tutorials concerning making designs as extensions?
It should be like this by default, no need for extra design folder, BTW :)

Shiki soku ze ku...

André R.

Thursday 12 March 2009 6:27:33 am

> Are there any tutorials concerning making designs as extensions?
No, but it's a matter of:
1. create a extension folder with design folder and a folder beneath there with design name
2. create a settings folder with a site.ini[.append.php] and a design.ini[.append.php] (last bits is for added security)
3. set [ExtensionSettings]DesignExtensions[]=myextension_name in the new design.ini
4. activate the extension in your settings/override/site.ini file
5. optional: define extension as translation extension if you need .ts files for your i18n needs using: [RegionalSettings]TranslationExtensions[]=myextension_name in site.ini
6. optional: if your design name is something other then the once activated, activate it with design settings mentioned above for the siteaccess you want it.

Look in the ezwebin extension for how all this is done(and more).

> It should be like this by default, no need for extra design folder, BTW :)
The design/ folder is for design bundled with ezpublish(in our case at least), admin might end up in an extension soon, but there should always be a fallback design (standard).

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Noicokuna Niemoge

Thursday 12 March 2009 6:38:27 am

Thank you very much!

Shiki soku ze ku...

Davide Garzetti

Thursday 12 March 2009 8:44:26 am

I tested Andrè suggestions and all works fine but I have dicovered a drawback in this scenario:

1)Do login on the Admin interface click on Design tab and Templates (left menu item)
2) Search a template overriden (ie Pagelayout.tpl)

and you will find that EzP does not see templates override files inside extension design.

Noicokuna Niemoge

Saturday 14 March 2009 12:40:25 pm

I think that generally the template and design area of eZ needs some improvements...

Shiki soku ze ku...

Sébastien Morel

Saturday 14 March 2009 1:56:22 pm

Hi,

I have a question about this method, when you override the "view line" of a concent class, where do you put the section, in wich override.ini ?

In the override.ini of the extension or in the settings/siteaccess ?
I don't think is in the override.ini of the extension because the admin interface will be affect.

So, like ezwebin, it's in the siteaccess. I think that it's a good method but it is unfortunate that ez Publish can't use override method with the siteaccess.

In fact, It would be cool if we could override the settings of a siteaccess in an extension...

What do you think about this?

Séb
++

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

André R.

Saturday 14 March 2009 6:27:37 pm

David: I guess you places your siteaccess settings in the extension?

> I don't think is in the override.ini of the extension because the admin interface will be affect.

True, its because many of the gui parts in admin where you can see different stuff pr siteaccess doesn't support this scenario, we know about it and might already have a fix for it for 4.1.1 (4.1 is in deep freeze now, and the patch for this is pretty big.).

So currently best to have siteaccess settings (including overrides) in settings/siteaccess and not extension/*/settings/siteaccess.

> What do you think about this?

There is an issue about this, please comment on that there instead so we might come to an conclusion on that...( As I created the issue you can guess that I would like to solve it somehow :) ).
http://issues.ez.no/IssueView.php?Id=13382&activeItem=27

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

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

eZ debug

Timing: Jan 18 2025 10:43:09
Script start
Timing: Jan 18 2025 10:43:09
Module start 'layout'
Timing: Jan 18 2025 10:43:09
Module start 'content'
Timing: Jan 18 2025 10:43:10
Module end 'content'
Timing: Jan 18 2025 10:43:10
Script end

Main resources:

Total runtime0.9187 sec
Peak memory usage4,096.0000 KB
Database Queries84

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0088 587.9375152.6250
Module start 'layout' 0.00880.0036 740.562539.4453
Module start 'content' 0.01250.9047 780.0078748.2969
Module end 'content' 0.91720.0014 1,528.304724.1563
Script end 0.9187  1,552.4609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4209160.0002
Check MTime0.00130.1434160.0001
Mysql Total
Database connection0.00160.179010.0016
Mysqli_queries0.828990.2231840.0099
Looping result0.00100.1078820.0000
Template Total0.878995.720.4394
Template load0.00210.233820.0011
Template processing0.876795.427620.4383
Template load and register function0.00010.016310.0001
states
state_id_array0.00090.096910.0009
state_identifier_array0.00220.235620.0011
Override
Cache load0.00200.2158610.0000
Sytem overhead
Fetch class attribute can translate value0.00070.073550.0001
Fetch class attribute name0.00130.1463130.0001
XML
Image XML parsing0.00260.283250.0005
class_abstraction
Instantiating content class attribute0.00000.0035150.0000
General
dbfile0.00140.1526290.0000
String conversion0.00000.001440.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
10content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
16content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 41
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs