Forums / Setup & design / Can't override full.tpl template in ezp 3.5.2

Can't override full.tpl template in ezp 3.5.2

Author Message

Iain MacLean

Tuesday 17 May 2005 5:40:07 am

Hi

Hope someone can help me with this.

I have upgraded an ezp 3.4.2 multi-site development installation to ezp 3.5.2, following all the correct upgrade steps in the docs. Then I manually created a new site access, complete with correct design, settings and var directories, all of which have the correct permissions. I then imported one of the styles packages to use as the basis for the layout of the site design, which created a collection of directories and files in the site access override directory, as well as putting some templates (e.g. menu templates and path.tpl) in the site access template directory.

The problem now is that only some of my override templates are used. In particular, I an unable to override the full.tpl template with any of the override templates. For instance, in the override.ini.append.php file I have two similar override blocks:

[full_folder]
Match[class_identifier]=folder
Source=node/view/full.tpl
MatchFile=full/folder.tpl
Subdir=templates

[line_folder]
Match[class_identifier]=folder
Source=node/view/line.tpl
MatchFile=line/folder.tpl
Subdir=templates

The override for the line.tpl works, while the full.tpl override does not. Everytime, the site uses design/standard/templates/node/view/full.tpl instead of the override.

I have changed the order of the blocks in the override.ini.append.php file to make sure the most general ones are last (learned that trick a long time ago). I even deleted the rest of the override blocks and left only the one for full.tpl. It still didn't work.

If I move the two templates into the directory /design/<site_access>/override/templates, I get the same result: the line.tpl override works and the full.tpl one doesn't.

If I copy design/<site-access>/override/template/full/folder.tpl to design/<site_access>/templates/node/view/full.tpl, then the override template is used and the full_folder is displayed how I want it. So, at least that part of the cascade is working. However, that's no use, as I need to be able to override full.tpl with several other templates.

I get the same result with the following override blocks:

[infopage]
Match[class_identifier]=info_page
Source=node/view/full.tpl
MatchFile=full/infopage.tpl
Subdir=templates

and

[full_article]
Match[class_identifier]=article
Source=node/view/full.tpl
MatchFile=full/article.tpl
Subdir=templates

Neither of these override full.tpl.

Templates that do not have overrides, such as design/<site_access>/templates/menu/flat_left.tpl and design/<site_access>/templates/parts/path.tpl are used in the correct way.

I have cleared the cache every time I make a change, and checked in the var directory to make sure the files are actually deleted (which they were). So, it appears that it' not a caching problem.

Has anyone else struck this? If so, what did you do to solve it. Or can someone see a mistake I have made? Is it anything to do with using one of the styles packages?

This is driving me mad (a not uncommon stage of mind for eZpublish developers). I've spent most of today trying to find the cause and I have ground to a halt!

Cheers

Iain MacLean

Łukasz Serwatka

Wednesday 18 May 2005 1:10:16 am

Hi Iain,

Go to Design->Templates->/node/view/full.tpl and set higher prioritys for your templates. Then clear the all cache.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Iain MacLean

Wednesday 18 May 2005 3:24:03 am

Hi Lukasz

Thanks for the suggestion. I'd like to try that, but when I go to Design->Templates->/node/view/full.tpl (or any of the templates in the list) I always get an error message like this:

"You don't have permission to access /visual/templateview/node/view/full.tpl on this server."

I presume this is a permissions issue with some part of the file system (I'm obviously logged on as admin), but I haven't been able to work out what to do about it. All the templates in /design/standard/templates/ have permissions of 664 and the folders are 755. Is that what they should have?

I would be grateful for any suggestions on what I should do so I could use the admin interface.

However, how would using the admin interface be different to just directly editing the override.ini.append.php and moving the override blocks around? I did try moving the /node/view/full.tpl down the file one block at a time, but had no luck.

Cheers

Iain

Łukasz Serwatka

Wednesday 18 May 2005 3:29:43 am

If you have access to shell you can run from your ezroot dir ./bin/modfix.sh script or run chmod -R 777 var/ settings/ design/

You can change permission via ftp client too.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Iain MacLean

Wednesday 18 May 2005 4:20:50 am

Hi Lukasz

Thanks very much, that fixed the permissions problem, although I also realised that I had the rewrite rule to remove index.php from the admin pages URIs in the Vhosts directive for the admin site. Removing the rewrite rule so that index.php is included in the URI means that I can now use the admin interface to create and edit override templates.

However, I still have my original problem. No matter what priority I give to the override block for the /design/standard/templates/node/view/full.tpl template in the override.ini.append.php file, the override doesn't work. Even if I use an override.ini.append.php file that contains just a single override - i.e. for the full.tpl template - it still doesn't work, and the default full.tpl template from the standard site design is always used. The overrides for the line.tpl all seem to work properly, but none of the overrides for full.tpl.

I'm still completely stumped!

Cheers
Iain

Iain MacLean

Thursday 19 May 2005 3:10:24 am

Well, I found the cause of the problem. It was having this block:

[OverrideSettings]
#Remember to enable this when finished development
Cache=disabled

in the site.ini.append.php file. When I changed it to "enabled", the override of full.tpl worked. This has never given me any problems before in sites developed with ezp3.4.x, so I don't understand why it would now.

Of course, I had to do a complete new plain install, using the installer, and do a whole lot of modifications, before I figured it out. :-( I realised what the cause was when I started copying entries from an old site.ini.append.php file into the new one.

Happy days!

Cheers
Iain