Forums / Setup & design / Clean way of altering ezwebin templates

Clean way of altering ezwebin templates

Author Message

Jon Staines

Thursday 08 February 2007 4:07:09 am

Hi,

I'm trying to find the proper way of altering the pagelayout and other templates now that there is the ezwebin design system. I tried creating an extension which would be called after the ezwebin one, and this worked and called the template from the new extension but it broke the admin interface. I then tried calling this extension in just the eng siteaccess by using

[ExtensionSettings]
ActiveAccessExtension[]=newextensionname

in the site.ini.append.php of the eng siteaccess. But this does nothing.

Any help would be appreciated. I'd prefer to learn the correct way of doing it rather than start altering the templates in the ezwebin folder (unless that is the way to do it).

Regards
Jon

christian bencivenni

Wednesday 14 March 2007 12:19:17 am

I have the same problem.
Did you resolve it?

Paul Wilson

Wednesday 14 March 2007 1:35:07 am

Hi Jon and Christian,

Try this ... it's worked for me.

If you create an extension and put your design templates in an appropriate folder, for example:

/extension/myextensionname/design/standard/templates/

Then enable the extension via the admin interface (or via ini files ... shouldn' t matter).

Then edit your siteaccess override.ini.append.php (eg in eng siteaccess folder for 3.9.0) add add an override items - for example:

[my_template_override]
Source=node/view/full.tpl
MatchFile=my_template_override.tpl
Subdir=templates
Match[node]=143

<b>I suspect that as long as the following conditions are met, everything will work: </b>

1. [Most Important...] the matchfile's name is different from those in the ezwebin extension (ie you're not trying to create a matchfile called pagelayout.tpl)

2. [Perhaps ...] the name of the template override titlie/identifier needs to be different (ie the [my_template_override] shown above.

<b>Why? </b>
EZ Publish seems to search for template matchfiles across any available extensions / designs. Changing the name of your templates means they're not going to be confused with ezwebin ones.

You can see / test this by changing the matchfile name in your override.ini.append.php file to something that just does not exist in your ezpublish. For example:

...
MatchFile=theres_no_way_this_template_exists.tpl
...

If you've got debug / template debug activated, you'll see the results of EZ Publish searching through extensions / designs trying to find the file.

For example:

Error: eZTemplateDesignResource::overrideArray Mar 14 2007 19:17:15 
Custom match file: path 'theres_no_way_this_template_exists.tpl' not found in any resource. Check template settings in settings/override.ini
 
Error: eZTemplateDesignResource::overrideArray, tried files Mar 14 2007 19:17:15 
design/standard/templates/theres_no_way_this_template_exists.tpl, design/standard/override/templates/theres_no_way_this_template_exists.tpl ... (etc)

Hope this helps.

Regards

- Paul

christian bencivenni

Wednesday 14 March 2007 1:45:34 am

Hi Paul.
thanks a lot.
I supposed of a similar solution but you really clear the work.
This afternoon I will try your solution.

Christian

Jon Staines

Wednesday 14 March 2007 2:14:37 am

Thanks for the reply. I'll give this a go later today.

I was hoping for a way to do it without setting up overrides for everything. So that you could just have an extension whose version of full/folder.tpl (for example) gets called instead of the normal full/folder.tpl (not counting separate overrides).

Up until now I've just been altering the ezwebin templates to make it work. While this works fine it isn't very neat as I've got to keep backups of the originals in case they're ever needed by something.

Paul Wilson

Wednesday 14 March 2007 2:40:29 am

Hi Jon,

Hmm ... without a lot of overrides.

I guess you could just keep a backup of the entire ezwebin folder ... use FTP to copy to your local machine, change the name of the folder to (eg) backup_ezwebin and upload it again ... just to keep the files in the same spot. But I expect you've already thought of this.

Another less pretty alternative might be to:
1. do the above, except call the copied ezwebin folder somethink like my_ezwebin
2. change the extension/my_ezwebin/settings files and extension sub-folders to reflect this change in name (ie to my_ezwebin)
3. enable the my_ezwebin extension, and disable the ezwebin extension.

... this might be appropriate if you want to keep your files organised to transfer/use on another site.

- Paul

Jon Staines

Wednesday 14 March 2007 2:46:49 am

Yeah, thought it mind end up being like that. Just keeping a copy of the original somewhere.

Thanks anyway for the help.

christian bencivenni

Wednesday 14 March 2007 7:43:49 am

mmmm...
it seems there is a problem.
I'm not sure but the ezwebin extensions seems more rilevant of the other extensions.
This means that even if I copy-and-rename the directory ezwebin and modify the template inside it they will not be loaded.
How can I set the extensions priority?

Jon Staines

Wednesday 14 March 2007 9:59:19 am

I followed the instructions on this page http://ezpedia.org/wiki/ez/overriding_the_default_website_interface_extension when I was first investigating this and encountered the problems which led me to make this post. However, I've just tried them again to check what I was going to reply to Christian with and it didn't have the problem. I could edit the pagelayout.tpl in ezwebin_custom and it didn't break the admin interface, and would fall back to using the ezwebin extension if it couldn't find a template within my ezwebin_custom one.

I'll let you know if I come across what caused the problem the first time around.

eZ debug

Timing: Jan 18 2025 19:02:56
Script start
Timing: Jan 18 2025 19:02:56
Module start 'content'
Timing: Jan 18 2025 19:02:57
Module end 'content'
Timing: Jan 18 2025 19:02:57
Script end

Main resources:

Total runtime1.0658 sec
Peak memory usage4,096.0000 KB
Database Queries214

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0079 587.8281180.8281
Module start 'content' 0.00790.8768 768.6563638.1094
Module end 'content' 0.88470.1811 1,406.7656344.4453
Script end 1.0657  1,751.2109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3818210.0002
Check MTime0.00150.1418210.0001
Mysql Total
Database connection0.00150.143410.0015
Mysqli_queries0.953889.49202140.0045
Looping result0.00260.24032120.0000
Template Total1.029896.620.5149
Template load0.00200.191420.0010
Template processing1.027896.426520.5139
Template load and register function0.00020.017410.0002
states
state_id_array0.00140.130310.0014
state_identifier_array0.00120.116920.0006
Override
Cache load0.00190.1801730.0000
Sytem overhead
Fetch class attribute can translate value0.00180.164340.0004
Fetch class attribute name0.00170.1569110.0002
XML
Image XML parsing0.00420.391040.0010
class_abstraction
Instantiating content class attribute0.00000.0030150.0000
General
dbfile0.00760.7106330.0002
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
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
17content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
7content/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: 45
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs