Forums / Setup & design / Moving a siteaccess design into an extension

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