View Modes - Bug or stupidity?

Author Message

Tristan Koen

Wednesday 23 July 2003 7:03:05 am

I have encountered some strange behaviour on ez3.1-1 when creating custom view modes.
If I create a new view template - say myview.tpl - and copy it across in to my /design/mysite/override/templates/node/view directory, it works perfectly with
{node_view_gui view=myview content_node=$Section:item}

The problem comes in when I try to restrict the template to a specific class - in my case, folders. My understanding is that the restriction is handled by changing the filename. So in my case I rename the template to myview_class_1.tpl and it *should* work.

For some reason it doesn't and I am getting quite frustrated here. Can anyone shed some light on this problem? Is it a bug or am I just extremely stupid?

Regards,

Tristan

Michael Bolien

Wednesday 23 July 2003 7:37:02 am

Hi Tristan, it's not your stupidy, it's because they change the template override behaviour in 3.1.1.

I encountered the same phenomenon. And you have two choices: first you can setup
{node_view_gui view=myview_class_1.tpl content_node=$Section:item}
this will show your template for all classes
or
you can use the new override.ini.append in your settings/siteaccess/design-folder. Here you have to enter in the override.ini.append:
[myview]
Source=node/view/full.tpl
MatchFile=myview.tpl
Subdir=templates
Match[class]=1

in your template you should enter:
{node_view_gui view=full content_node=$Section:item}

That should do it.

Michael

Tristan Koen

Thursday 24 July 2003 12:15:56 am

Thanks Michael. Now that I think about it, it does make sense in terms of presenting a consistent override framework.

ezTeam: Please would you remove the 'old style' view mode templates from the demo in the next release? I have used the demo as a source of examples for most of my learning curve and this one really caught me out...

Regards,

Tristan

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.