Forums / Developer / Extension - Pagelayout

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

eZ debug

Timing: Jan 19 2025 06:30:48
Script start
Timing: Jan 19 2025 06:30:48
Module start 'content'
Timing: Jan 19 2025 06:30:48
Module end 'content'
Timing: Jan 19 2025 06:30:49
Script end

Main resources:

Total runtime0.1733 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0095 588.8516180.8438
Module start 'content' 0.00950.0049 769.6953109.9609
Module end 'content' 0.01440.1588 879.6563537.7500
Script end 0.1732  1,417.4063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00372.1599200.0002
Check MTime0.00150.8598200.0001
Mysql Total
Database connection0.00140.821110.0014
Mysqli_queries0.126973.20031410.0009
Looping result0.00150.86581390.0000
Template Total0.158291.310.1582
Template load0.00100.572910.0010
Template processing0.157290.707310.1572
Override
Cache load0.00060.363410.0006
Sytem overhead
Fetch class attribute can translate value0.00070.424710.0007
XML
Image XML parsing0.00030.170910.0003
General
dbfile0.00291.6799200.0001
String conversion0.00000.007430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs