Share » Forums » Setup & design » Strange override.ini - behaviour

Strange override.ini - behaviour

Strange override.ini - behaviour

Friday 18 July 2003 4:37:03 am - 11 replies

Author Message

Jan Borsodi

Friday 18 July 2003 4:49:42 am

The problem is that you're using a different viewmode in the node_view_gui. You use actual.tpl while the override is for full.tpl this means that the system will look for a node/view/actual.tpl file which doesn't exist.
Change the line to
{node_view_gui view=full content_node=$node}
and it should work.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Michael Bolien

Monday 21 July 2003 3:23:43 am

Hello Jan, thx for your reply! But there's something I don't understand:

You wrote, that the system looks for a page /node/view/actual.tpl and so I should change my template line into: {node_view_gui view=full content_node=$node} and then it works.

But, I the documentation of override.ini I found:

"...
[musicfolder]
Source=node/view/full.tpl
MatchFile=musicfolder.tpl
Subdir=templates
Match[class]=1
Match[section]=4

[welcomearticle]
Source=node/view/full.tpl
MatchFile=welcomearticle.tpl
Subdir=templates
Match[node]=42

This configuration will create two override templates, both will override node/view/full.tpl based on different settings. The first override template is named musicfolder.tpl and is located in override/templates/. This template will be used if someone is viewing an object with class ID 1 in section 4. The next override is named welcomearticle.tpl and will only be used when someone is viewing the node with ID 42.
...
If no overrides are found for the current node the standard file (node/view/full.tpl in this example) will be used. If this file is missing as well then the system will use the templates in the standard design.
..."
What is the belonging code in the template? Is it {node_view_gui view=full content_node=$node} ?????

BTW:
I changed
{node_view_gui view=actual content_node=$node}
in
{node_view_gui view=full content_node=$node}

the entry in my override.ini.append is
[actual]
Source=node/view/full.tpl
MatchFile=actual.tpl
Subdir=templates
Match[node]=236

and the system displays now full.tpl, although

Sorry, but I found the new override-system still illogical. It has cost me severals weeks for investigation, however none of my 3.0.2 sites are running with 3.1.

Believe me, they are very complex sites with special programming in the templates diving into depth 6 - and none is working under 3.1.

Either templates variables are not found or the templates itself are not found - although everything seems to be right configured.

If I don't find a solution until the end of this week, I'll look for another CMS because ez 3.1 doesn't work for me.

Hoping, that you'll understand, that I'm a little bit annoyed.

Michael

Jan Borsodi

Monday 21 July 2003 4:29:15 am

The 'node_view_gui' function is just an advanced include which generates the include uri automatically. It uses the 'view' parameter to select the correct template, ie.
{node_view_gui view=full}
is equal to
{include uri='design:node/view/full.tpl'}
while
{node_view_gui view=line}
is equal to
{include uri='design:node/view/line.tpl'}

The 'design:' part specifies the resource handler for getting templates, in this case a specialized handler which looks for templates in design directories and allows for overrides on special 'design' keys.

The override.ini file defines which 'design' uri's to match. If a match is done an override template is used. A match can also include checks on 'design' keys such as 'class', 'section' etc.

Could you explain what you think is illogical with the system. It might be that the documentation on it is not good enough.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Michael Bolien

Monday 21 July 2003 5:53:36 am

Yes, right, Jan - it seems to be the documentation, it lacks the overview. For you who are involdved into this project, everything seems clear, because you made. But we, your customers have to understand your intensions by creating ezpublish. Little by little pieces of that jigsaw appeared, but I think it takes too long time to discover all.

E.g. one of the sites I look after is physical.vorschauseite.de. The site is almost complete, but now I have to upgrade to 3.1.1 by order of my customer. So I'm hanging, because all had to be done last week and now .... look at physical-test.vorschauseite.de. That's "the upgrade" which do not work.

And that is the illogical part: how can it be, that templates in an upgrade don't work anymore. And why do you introduce a complete different override system that smashes the work of month into dust?

So, I'll continue trial and error, maybe it'll work in a few days. Todays task: Why is actual.tpl not shown although everything is quite right configured?

And another question or a statement: It seems to better to avoid that 'node_view_gui' and better use 'include'?

Regards,
Michael

PS: Now that: if I change that node_view_gui against include uri ... , the templates is found and works. I mean, this is illogical, too!

Bård Farstad

Monday 21 July 2003 7:50:37 am

Michael, we've also released an upgrade script for the template overrides. This will generate settings which is the same as the override files you've got.

To upgrade you do not need to change any templates, you only need to tell eZ publish which files should be used for which file and under which conditions.

It should be a matter of running this script and putting the output in your settings/mysiteaccess/override.ini.append to upgrade from 3.0 to 3.1. The only thing that may bug is if you have several settings which are more/less restrictive, eZ publish will then take the first match found in the override file.

--bård

Documentation: http://ez.no/doc

Michael Bolien

Monday 21 July 2003 8:36:15 am

Hi Bård,
tahnk you for answering! I ran that script as I installed the new distribution. The only result is:
<b>Warning</b>: Compilation failed: nothing to repeat at offset 45
in <b>/var/home/eztest/html/generateoverridesettings.php</b> on line <b>61</b><br />

Please, do me a favour:
I want you to call http://physical-test.vorschauseite.de and then choose a menuitem from the left code. The menu is included from a file called leftmenu.tpl. Is located in design/templates. As you can see on physical.vorschauseite.de, the whole stuff is working well with ez 3.0.2 . Here is the code of leftmenu.tpl:

{let menu_folder_list=fetch('content',list,hash(parent_node_id,2,sort_by,array(array(priority))))}
<table id="leftmenu" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="leftmenu"><img src={"leer.gif" | ezimage } width="15" height="10"></td>
<td class="leftmenu"><img src={"leer.gif" | ezimage } width="194" height="10"></td>
<td class="leftmenuline"><img src={"leer.gif" | ezimage } width="1" height="10"></td>
</tr>
<tr>
<td colspan="3"><img src={"menu-br-unten.gif" | ezimage } width="210" height="2"></td>
</tr>
{section name=Folder loop=$menu_folder_list offset=1}
{section-exclude match=$Folder:item.node_id|eq(60)}
{section show=or(and($Folder:item.node_id|ne($node.node_id),$node.depth|lt(3)),and($Folder:item.node_id|ne($node.parent_node_id),$node.depth|eq(3)),and($Folder:item.node_id|ne($node.path_array[2]),$node.depth|eq(5)),
and($Folder:item.node_id|ne($node.path_array[2]),$node.depth|eq(4)),$node.node_id|eq(236),$node.parent_node_id|eq(236))}
<tr>
<td colspan="3"><img src={"menu-br-oben.gif" | ezimage } width="210" height="1"></td>
</tr>
<tr>
<td colspan="2" class="leftmenu"><a href={concat("/content/view/full/",$Folder:item.node_id,"/")|ezurl}>
<img src={"menu-dot.gif" | ezimage } width="15" height="21" border="0" align="middle">{$Folder:item.name}</a></td>
<td class="leftmenuline"><img src={"leer.gif" | ezimage } width="1" height="21"></td>
</tr>
<tr>
<td colspan="3"><img src={"menu-br-unten.gif" | ezimage } width="210" height="2"></td>
</tr> {* Obermenupunkt *}
{section-else}
{node_view_gui view=menuitem content_node=$Folder:item choice=$node.node_id level3=$node.path_array[3]}
{/section}
{/section}
<tr>
<td colspan="3"><img src={"menu-br-oben.gif" | ezimage } width="210" height="1"></td>
</tr>
<tr>
<td class="leftmenu"><img src={"leer.gif" | ezimage } width="15" height="3"></td>
<td class="leftmenu"><img src={"leer.gif" | ezimage } width="194" height="3"></td>
<td class="leftmenuline"><img src={"leer.gif" | ezimage } width="1" height="3"></td>
</tr>
<tr>
<td class="leftmenu"><img src={"leer.gif" | ezimage } width="15" height="21"></td>
<td class="leftmenuitem">
<div class="searchblock">
<form name="search" action={"/content/search/"|ezurl} method="get">
<input type="hidden" name="SectionID" value="2"><a class="topmenu" href="javascript:document.search.submit();">Suche</a>
<input class="searchtext" type="text" name="SearchText" id="Search" value="" />
</form>
</div></td>
<td class="leftmenuline"><img src={"leer.gif" | ezimage } width="1" height="21"></td>
</tr>
<tr>
<td class="leftmenu"><img src={"leer.gif" | ezimage } width="15" height="300"></td>
<td class="leftmenu"><img src={"leer.gif" | ezimage } width="194" height="10"></td>
<td class="leftmenuline"><img src={"leer.gif" | ezimage } width="1" height="10"></td>
</tr>
</table>
{/let}

What is wrong? Why is this code not working? What do I have to add in the override.ini or should I switch from node_view_gui to an include-statement?

I'm so puzzled,
Michael

Michael Bolien

Tuesday 22 July 2003 1:28:09 am

@Jan: the override system is illogical because in a menustructure, you cannot decice, which item you should use. E.g. the source above:
If a menuitem is selected, you should include the file menuitem_class1.tpl, which worked well in old 3.0.2.

Now, you have to tell in override.ini that you want menuitem.tpl. But how should this work? You can't distinguish if you want a folder or a menuitem or an article, because the entry in override.ini looks like that:

[menuitem]
Source=node/view/full.tpl
MatchFile=menuitem.tpl
Subdir=templates
Match[class]=1

If the tag in brackets could be used for making a distinction, this thing would work. But so, you can never say, which node will be selected, you can never say, which node will not be selected. The only thing I wonder about is, you can make an entry for every single menuitem you can choose. This should work, but makes this weird thing much more complicated then useful.

Any ideas?

And sonthing I won't forget: Even if I configure everything as suggested in this thread -> the override mechanism isn't work! I can only setup the include-statement, nove_view_gui doesn't work.

Maybe our sites are to complex for ezPublish.

Regards,
Michael

Tim Achnitz

Tuesday 22 July 2003 2:46:01 am

Hi,

sorry that I'm interfering your discussion, but I think I have the simular problem.
Since last week I'm running the 3.1 version of eZ Publish and had to integrate all my templates from the old version with this generateoverridesettings.php. After all, it worked correctly and the templates were found.
But how can I implement a new template in 3.1?????? I'm creating a new file "edit_class_49.tpl" in "/design/mysite/override/templates/content" and add this to my override.ini.append:

[edit_class_49]
Source=content/edit.tpl
MatchFile=content/edit_class_49.tpl
Subdir=templates
Match[class]=49

In the frontend this template can't be found. I'm also wondering why you are building a new template system in which the old templates don't work automatically...or did I do anything wrong?

Michael Bolien

Tuesday 22 July 2003 2:46:28 am

Suddenly, someone like the holy ghost floated across our office and whispered: "Why do you need the overriding-system? You have only one sort of templates ....." - And, the inspiration came!

Our workaround is to specify the complete name of our templates in the node_view_gui - funktion.

E.g.
{node_view_gui view=info ...}
changes to
{node_view_gui view=info_class_33 ...}

So we don't need that override.ini.append stuff and all is working!

Michael

Michael Bolien

Tuesday 22 July 2003 11:36:42 am

Hi Tom,

I think you don't have to use subfolders in your content.ini entry.
Look at this: http://www.ez.no/developer/ez_publish_3/documentation/customization/custom_design/override_templates

Regards,
Michael

liu spider

Wednesday 23 July 2003 10:44:14 am

I think I have found the course, please see the new NOTICE paragraph in the document:

http://www.ez.no/developer/ez_publish_3/documentation/customization/custom_design/override_templates

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu