Forums / Install & configuration / How to override the page layout?

How to override the page layout?

Author Message

Christian Johansen

Friday 06 August 2010 5:17:16 am

I'm trying to create an ical_pagelayout to serve up some content as an ical feed. I've followed the steps outlined here: http://share.ez.no/forums/developer/pagelayout-icalendar

This kinda works - visiting http://mysite/layout/set/ical/mynode/ sets the right headers and so on, but I cannot for the life in me get eZ (4.0.3) to correctly load the page layout. I tried saving the layout several places:

  • design/myaccess/templates/ical_pagelayout.tpl
  • design/myaccess/override/templates/ical_pagelayout.tpl
  • ...and even in design/standard/ical_pagelayout.tpl

No matter where I put it, eZ tells me "can't load template 'ical_pagelayout.tpl' with resource 'design'". What am I doing wrong?

Romeo Antony

Friday 06 August 2010 5:49:04 am

Reasons may be either your overriding conditons for ical_pagelayout.tpl would be wrong or you didn't specified the correct design specifications in ini files? Can you check both of these?

Christian Johansen

Friday 06 August 2010 6:24:19 am

I'm not sure what you mean by "the correct design specifications in ini files"? Do you mean site design and so on? This is what I did:

settings/siteaccess/mysite/layout.ini.append:

[ical]

PageLayout=ical_pagelayout.tpl

I also added

settings/siteaccess/mysite/override.ini.append:

[ical_pagelayout]

Source=ical_pagelayout.tpl

MatchFile=ical_pagelayout.tpl

Subdir=templates

I tried keeping the layout file in design/mysite/templates/ical_pagelayout.tpl, which caused a lot of errors. It said "tried paths ...", then I copied the file over to one of those paths, namely design/mysite/override/templates/ical_pagelayout.tpl, and now I'm back to:

Warning: eZTemplate Aug 06 2010 15:14:02
No template could be loaded for "ical_pagelayout.tpl " using resource "design"

What am I missing?

Thiago Campos Viana

Friday 06 August 2010 7:35:20 am

Hi

You don't need:

settings/siteaccess/mysite/override.ini.append.php:

[ical_pagelayout]

Source=ical_pagelayout.tpl

MatchFile=ical_pagelayout.tpl

Subdir=templates

I think just:

settings/siteaccess/mysite/layout.ini.append.php:

....

[ical]

PageLayout=ical_pagelayout.tpl

...

and creating the file design/mysite/templates/ical_pagelayout.tpl is enough, write just a "hello" in this file just for testing purposes, but you may check your settings/siteaccess/mysite/site.ini.append.php if it includes your design folder in you design settings:

[DesignSettings]
SiteDesign=mysite

AdditionalSiteDesignList[]
AdditionalSiteDesignList[]=ezflow
AdditionalSiteDesignList[]=ezwebin
AdditionalSiteDesignList[]=base
AdditionalSiteDesignList[]=standard

Then clear all caches and test again. Even tough this may work, I highly recommend you upgrade your ez publish site to at least version 4.1.3, since it solves a critical issue regarding blank users registrations and others minor ones.

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

Christian Johansen

Thursday 12 August 2010 12:41:07 am

Thanks, Thiago. Unfortunately, this still does not work for me. I still get "No template could be loaded for ical_pagelayout.tpl". I've double checked all settings. I even checked ownership and permissions for the file, but no luck.

I know that my site design is included, cause this is a running site, and e.g. the pagelayout.tpl from the same directed works fine elsewhere on the site. Is there any way I can get more debug information or whatever to figure out what's happening?

eZ debug

Timing: Jan 18 2025 15:58:21
Script start
Timing: Jan 18 2025 15:58:21
Module start 'content'
Warning: PHP: E_DEPRECATED Jan 18 2025 15:58:22
trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/ze/public_html/share.se7enx.com/var/community/cache/template/compiled/table-c0a31fef795ad927ef08940ddf2d392f.php on line 147
Timing: Jan 18 2025 15:58:22
Module end 'content'
Timing: Jan 18 2025 15:58:22
Script end

Main resources:

Total runtime0.9772 sec
Peak memory usage4,096.0000 KB
Database Queries203

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 587.8281180.8281
Module start 'content' 0.00670.8145 768.6563628.5859
Module end 'content' 0.82120.1559 1,397.2422337.5859
Script end 0.9771  1,734.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.4312210.0002
Check MTime0.00160.1659210.0001
Mysql Total
Database connection0.00120.127810.0012
Mysqli_queries0.875889.62272030.0043
Looping result0.00240.24312010.0000
Template Total0.940396.220.4701
Template load0.00210.210620.0010
Template processing0.938296.009820.4691
Template load and register function0.00020.016710.0002
states
state_id_array0.00180.188710.0018
state_identifier_array0.00200.207620.0010
Override
Cache load0.00190.1906670.0000
Sytem overhead
Fetch class attribute can translate value0.00140.141040.0003
Fetch class attribute name0.00120.122170.0002
XML
Image XML parsing0.00660.673440.0016
class_abstraction
Instantiating content class attribute0.00000.004470.0000
General
dbfile0.00930.9512330.0003
String conversion0.00000.000730.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
14content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
2content/datatype/view/ezxmltags/td.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/td.tplEdit templateOverride template
2content/datatype/view/ezxmltags/tr.tpl<No override>extension/community/design/community/templates/content/datatype/view/ezxmltags/tr.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/table.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/table.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 40
 Number of unique templates used: 14

Time used to render debug report: 0.0002 secs