Moving a siteaccess design into an extension

Author Message

Graham Tillotson

Sunday 09 December 2007 4:46:59 am

I would like to move an existing design (/design/mydesign) into an extension (/extension/mysite/design/mydesign) and was wondering if anyone had a list of steps to make this happen. Even a basic list would help and I could take it from there.

I see that in the ezwebin example the core designs (admin, base, standard) all remain in the /design/ directory, and that makes sense in terms of upgrades, but why is there an empty shell for templates in /design/ezwebin? Is that directory structure necessary even though there are no templates stored there?

At a higher level, what are the benefits of moving a design into an extension? I just want to make sure that I'm setting up templates in a way that is aligned with best practices for future releases.

DUO : CONSULTING
Web content management experts
www.duoconsulting.com

Jon Staines

Monday 10 December 2007 6:25:54 am

Its pretty straight forward to use the design as an extension. First come up with a name for your extension, might as well use mydesign for example purposes. Make a directory within extension for that. Also make design and settings folders inside your new mydesign folder. Then move the /design/mydesign that you already have into /extension/mydesign/design/. Your structure should now be something like:

/extension
 -collectexport
 -ezdhtml
 -ezodf
 -ezpaypal
 -ezwebin
 -mydesign
 --settings
 --design
 ---mydesign
 ----override
 ----templates

And so on.

Within the settings folder you need a design.ini.append.php with at least the following:

<?php /* #?ini charset="utf-8"?

[ExtensionSettings]
DesignExtensions[]=mydesign

*/ ?>

In you siteaccess settings (eg /settings/siteaccess/eng/) you need to alter site.ini.append.php. Look for the DesignSettings part and add your design:

[DesignSettings]
SiteDesign=mydesign
AdditionalSiteDesignList[]=ezwebin
AdditionalSiteDesignList[]=base

And activate the extension:

[ExtensionSettings]
ActiveAccessExtensions[]=mydesign

Clear the cache and check your site. This should be all you need to get going.

Graham Tillotson

Monday 10 December 2007 12:16:03 pm

This is great -- I'll let you know how it goes. I went through these basic steps the first time around, but my design kept reverting back to base/standard. I'll go through it again and let you know how it goes. I'm sure it is a config setting on my side somewhere.

DUO : CONSULTING
Web content management experts
www.duoconsulting.com

Piotrek Karaƛ

Monday 10 December 2007 12:54:02 pm

Hi there,

> <i>At a higher level, what are the benefits of moving a design into an extension? I just want to make sure that I'm setting up templates in a way that is aligned with best practices for future releases.</i>

I don't know any core arguments, but I'd expect that separation is always a good choice. Easier backup, easier upgrades, easier code referral, easier preparation of own packages... You may always need to turn a design extension into a more complex one, for example by adding your own module/views, settings, additional classes, translations etc. Much easier to manage if you have it all in one space.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Graham Tillotson

Wednesday 12 December 2007 4:04:51 am

Ha! Good old eZ. Sure enough -- the only thing I missed was the line in design.ini.append.php. I updated it for my siteaccess, cleared the cache, and the design came up. Thanks much for the help.

I totally agree that the single directory is a much cleaner way to go for management and backups. That alone is worth moving the design over.

DUO : CONSULTING
Web content management experts
www.duoconsulting.com

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 18:31:51
Script start
Timing: Jan 18 2025 18:31:51
Module start 'layout'
Timing: Jan 18 2025 18:31:51
Module start 'content'
Timing: Jan 18 2025 18:31:51
Module end 'content'
Timing: Jan 18 2025 18:31:51
Script end

Main resources:

Total runtime0.7667 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 588.0469152.6406
Module start 'layout' 0.00610.0024 740.687539.4766
Module start 'content' 0.00850.7567 780.1641614.1719
Module end 'content' 0.76510.0015 1,394.335916.1250
Script end 0.7666  1,410.4609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4173160.0002
Check MTime0.00130.1665160.0001
Mysql Total
Database connection0.00100.130710.0010
Mysqli_queries0.700691.3788650.0108
Looping result0.00080.1014630.0000
Template Total0.739796.520.3698
Template load0.00220.287120.0011
Template processing0.737596.193620.3687
Template load and register function0.00010.015810.0001
states
state_id_array0.00070.091110.0007
state_identifier_array0.00080.110220.0004
Override
Cache load0.00180.2403310.0001
Sytem overhead
Fetch class attribute can translate value0.00110.141330.0004
Fetch class attribute name0.00140.182980.0002
XML
Image XML parsing0.00270.355230.0009
class_abstraction
Instantiating content class attribute0.00000.0031100.0000
General
dbfile0.00160.2061290.0001
String conversion0.00000.000840.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
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 6

Time used to render debug report: 0.0003 secs