Share » Forums » Setup & design » node_view_gui skips output using...

node_view_gui skips output using override

node_view_gui skips output using override

Monday 11 December 2006 11:04:59 am - 5 replies

Author Message

Martin B

Monday 11 December 2006 11:07:35 am

Just to make sure: the foreach loop gives me good nodes, too.

Martin B

Wednesday 13 December 2006 9:43:43 am

Sorry to bump this topic in such a way, but I narrowed down the problem a bit.
It's definitely to do with the custom view, I can put in a full view without problems.

Can someone tell me how I need to set up an override when I'm using my own view mode (i.e. not full, line or anything that exists already)?

Claudia Kosny

Wednesday 13 December 2006 10:44:24 am

Hi Martin

First of all remove the override condition again. If you specify a view 'archivetable', this view will be used, so overriding the view 'full' is not necessary (and does not help). Then make sure that you have a template called 'archivetable.tpl' in the folder design/<design_dir>/templates/node/view or design/<design_dir>/override/templates/node/view (I usually use the override folder but as far as I know it does not matter). Enable full debug output, especially the list of used templates and the template debug option. Then clear the cache and try again.

If it still does not work, check the debug output - what template is it trying to load? If necessary surround the loop in the template with a {debug-timing-point id=...}, this might make it easier to find the relevant messages.

Claudia

Martin B

Thursday 14 December 2006 4:43:02 am

Hi Claudia,

thanks, that provided me exactly with the missing information.
Overriding my own node/view template still doesn't seem to work, but I guess I don't need that any more.

Christian Johansen

Saturday 16 December 2006 12:42:43 am

You can make your own view modes, and if you always have overrides, you don't need to have the base file in place. Example:

In some template you do

{def $node_list=fetch('content', 'list'
                      hash('parent_node_id', $node.node_id,
                           'class_filter_type', 'include',
                           'class_filter_array', array('someclass')))}

Now you are asking for the view "archivetable", which doesn't exist by default. That's not a problem - it doesn't even have to exist at all, as long as eZ can find it's override file. It's important to note also that you are overriding the view mode, which is "archivetable", not "full".

[linkmag_archive_tablerow]
Source=node/view/archivetable.tpl
MatchFile=linkmag_archive_tablerow.tpl
Subdir=templates
Match[class_identifier]=link_mag

So, it doesn't matter that node/view/blabla.tpl doesn't exist, as long as you have enought control to know that you won't ask for the view "blabla" for any node that doesn't override this template. It sounds complicated, but in practice it works great for me.

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

36 542 Users on board!

Forums menu