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?

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 30 2025 19:41:24
Script start
Timing: Jan 30 2025 19:41:24
Module start 'layout'
Timing: Jan 30 2025 19:41:24
Module start 'content'
Timing: Jan 30 2025 19:41:24
Module end 'content'
Timing: Jan 30 2025 19:41:24
Script end

Main resources:

Total runtime0.0258 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 588.2500151.2266
Module start 'layout' 0.00650.0040 739.4766220.7188
Module start 'content' 0.01050.0139 960.19531,002.9453
Module end 'content' 0.02430.0015 1,963.140637.9922
Script end 0.0258  2,001.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002710.3201140.0002
Check MTime0.00104.0274140.0001
Mysql Total
Database connection0.00083.024510.0008
Mysqli_queries0.003513.736130.0012
Looping result0.00000.042510.0000
Template Total0.00114.110.0011
Template load0.00083.260910.0008
Template processing0.00020.836710.0002
Override
Cache load0.00062.238610.0006
General
dbfile0.00249.468680.0003
String conversion0.00000.032340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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