This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Setup & design » View Modes - Bug or stupidity?
expandshrink

View Modes - Bug or stupidity?

View Modes - Bug or stupidity?

Wednesday 23 July 2003 4:03:05 pm - 2 replies

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

Modified on Wednesday 23 July 2003 4:04:50 pm by Tristan Koen

Wednesday 23 July 2003 4:37:02 pm

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

Thursday 24 July 2003 9: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

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from