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 » eZ Publish 5 Platform » Rest API & Template overrides
expandshrink

Rest API & Template overrides

Rest API & Template overrides

Tuesday 27 March 2012 1:52:09 am - 3 replies

The Custom Output Renderers documentation mentions you can override the node/view/rest.tpl template, but this template doesn't exist, and results in an error:

 Notice: Undefined index: /node/view/rest.tpl in /kernel/common/eztemplatedesignresource.php on line 303

Adding this (empty) template into your design/<my_design>/templates/ folder resolves this issue; however it's unclear whether the default node/view/*.tpl override settings apply for this, and I can't seem to get it to output the template I want.

The URI I'm accessing is:

/api/ezp/content/node/66?OutputFormat=xhtml&translation=eng-NZ

and the override setting is:

[product_features_rest]
Source=node/view/rest.tpl
MatchFile=product/features.tpl
Subdir=templates
Match[parent_class_identifier]=product

and the rest_pagelayout.tpl only contains {$module_result.content}.

Any thoughts?  Thanks in advance,

Geoff

Modified on Tuesday 27 March 2012 1:55:01 am by Geoff Bentley

Thursday 14 June 2012 9:39:41 am

Hi,

You are using template override condition, so in practice you have to put your template inside design/(design_name)/override/templates/product/features.tpl

You don't have to create a template in design/<my_design>/templates/. By using template override condition "source" template does not have to exist physically on disk.

Thursday 14 June 2012 12:17:27 pm

Thanks for your reply, Lukas.

The issue is more that the override system doesn't seem to work in this case, ie, putting in overrides/templates/product/features.tpl doesn't actually produce the desired output.

Saturday 16 June 2012 10:43:47 am

@Geoff file a bug? I'll try to reproduce when I have time...

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from