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.

eZ debug

Timing: Jan 19 2025 04:42:21
Script start
Timing: Jan 19 2025 04:42:21
Module start 'layout'
Timing: Jan 19 2025 04:42:21
Module start 'content'
Timing: Jan 19 2025 04:42:22
Module end 'content'
Timing: Jan 19 2025 04:42:22
Script end

Main resources:

Total runtime1.1238 sec
Peak memory usage4,096.0000 KB
Database Queries90

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 589.0547152.6094
Module start 'layout' 0.00480.0027 741.664139.4141
Module start 'content' 0.00741.1148 781.0781886.4531
Module end 'content' 1.12220.0016 1,667.531324.1875
Script end 1.1238  1,691.7188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2996160.0002
Check MTime0.00140.1206160.0001
Mysql Total
Database connection0.00070.065710.0007
Mysqli_queries1.020090.7563900.0113
Looping result0.00090.0832880.0000
Template Total1.093497.320.5467
Template load0.00250.226720.0013
Template processing1.090897.063720.5454
Template load and register function0.00010.011510.0001
states
state_id_array0.00090.080310.0009
state_identifier_array0.00120.104420.0006
Override
Cache load0.00240.20951000.0000
Sytem overhead
Fetch class attribute can translate value0.00070.062280.0001
Fetch class attribute name0.00100.0916160.0001
XML
Image XML parsing0.00390.344880.0005
class_abstraction
Instantiating content class attribute0.00000.0024180.0000
General
dbfile0.00160.1448480.0000
String conversion0.00000.000740.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
8content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
10content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
24content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
12content/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: 63
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs