Extension - Pagelayout

Author Message

Sébastien Morel

Tuesday 25 April 2006 7:46:06 am

hello,

Can I override the pagelayout.tpl in my extension ?

I try several tests but I havent' find the solution...

I have EzPublish 3.6.1

Thanks

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

Felix Laate

Wednesday 26 April 2006 4:29:48 am

Hi there!

You could try to put

$Result['pagelayout'] = 'pagelayout_mylayout.tpl';

at the very end of your module. This at least works for me.

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Clemens T

Wednesday 26 April 2006 4:01:54 pm

You can override anything in your extension.

But you've gotta put it all in there, and it's some notepad coding.

Just create a

extension/your_extension/design/your_designname/templates/my_pagelayout.tpl

and
extension/your_extension/settings/siteaccess/your_designname/override.ini.append.php

and the code that needs to be in there...

what I did was just this, it's even easier:

extension/extension_name/design/your_designname/templates/pagelayout.tpl

and just write some code in there, clear cache, works here.

off course you've gotta set the designname of your site in some Site.ini (SiteDesign var.)

Greets,
Clemens

Kristof Coomans

Wednesday 26 April 2006 11:05:29 pm

You also got to tell eZ that your extension contains design elements:

In extension/your_extension/settings/design.ini.append, you put:

[ExtensionSettings]
DesignExtensions[]=your_extension

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Sébastien Morel

Wednesday 10 May 2006 4:48:34 am

Hello,
Ok , it Works !!!

My mistake was that the source tree of my code was :

extension/my_extension/design/standard/templates/pagelayout.tpl
at this place the pagelayout override doesn't work....

If I replace standard by the design name of the site, it works...

So, I have a question... for a generic extension, I don't know the design name, How can I do for this override works with "standard" as design name..

Thanks for your help

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

Sébastien Morel

Tuesday 16 May 2006 12:21:40 am

Anybody has an idea ?

Thanks

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

Xavier Dutoit

Tuesday 16 May 2006 2:30:06 am

Hi,

It looks first in the design/xxx (as defined by our siteaccess), then in the extension.

That's kind of logic, as that is unlikely that I want your extension to replace my pagelayout, but if you want it that way, just delete your design/xxx/template/pagelayout.tpl and it will use the one in your extension.

There has been a long discussion about the proper order on the override. I don't remember the details, beside it wasn't always logical and your surest best is to test ;)

X+

http://www.sydesy.com

Marc Sutter

Saturday 25 November 2006 2:27:43 am

Hi,
I'm working now since 3 weeks with ez, after much reading I would suggest this way:

Let's say you have following configuration:
siteaccess:<i>plain_site</i>
design: <i>plain_site</i>

<b>In your extension:</b>

1. Choose a new design name eg: your_extension_design
2. Create extension/your_extension/settings/design.ini.append.php

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

  [ExtensionSettings]
  DesignExtensions[]=your_extension

  */ ?>

3. Create extension/your_extension/design/your_extension_design/templates/your_new_pagelayout.tpl
as your override pagelayout.

<b>in the siteaccess setting</b>:
like Xavier said it's unlikely that one want your extension to replace his pagelayout by extension installation, so for the override to work let users change their config as follow:

1. In settings/siteaccess/your_siteacces/site.ini.append.php modify/add the design settings as follow:

[DesignSettings]
SiteDesign=plain_site
AdditionalSiteDesignList[]=your_extension_design
AdditionalSiteDesignList[]=base

more on AdditionalSiteDesignList here: http://ez.no/doc/ez_publish/technical_manual/3_8/reference/configuration_files/site_ini/designsettings/additionalsitedesignlist

2. In settings/siteaccess/your_siteacces/override.ini.append.php modify/add the override as follow:

[your_extension_pagelayout]
Source=pagelayout.tpl
MatchFile=your_new_pagelayout.tpl
Subdir=templates

3. Make sure your extension is active in settings/siteaccess/your_siteacces/site.ini.append.php:

[ExtensionSettings]
ActiveAccessExtensions[]=your_extension

 

Those settings work for me and I think it's the right way to go, but as I said I'm a new ez user.
Hope this helps.

Marc

André R.

Saturday 25 November 2006 4:34:05 am

To override your paglayout no mather what:
rename your pagelayout.tpl to myextension_pagelayout.tpl
and place it in myextension/design/standard/templates/
add a entry in myextension/settings/override.ini to override pagelaout.tpl

remember that this will also affect the admin siteaccess, so either put override.ini in myextension/settings/siteaccess/mysiteaccess/ or only activate the extension for the siteaccesses you use it on.

the override entry looks like this:

[myextension_paglayout_override]
Source=pagelayout.tpl
MatchFile=myextension_paglayout.tpl
Subdir=templates
Match[section]=25

the match is optional.

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

Piotrek Karaś

Tuesday 04 December 2007 6:12:51 am

Can anyone see any problems with the solution suggested by Felix?

$Result['pagelayout'] = 'pagelayout_mylayout.tpl';

Seems perfect for all project-dedicated extension pagelayouts...

--
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

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