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 » Developer » calling a template within a template
expandshrink

calling a template within a template

calling a template within a template

Friday 03 October 2014 12:44:43 pm - 5 replies

Hi,I have created a template called frontpagenew.tpl by overriding pagelayout.tpl.I want to include a header.tpl and a footer.tpl inside frontpagenew.tpl .I have used this code.{include uri="design:/header.tpl"}but it is not working.can I call a template within a template.

Friday 03 October 2014 4:49:18 pm

Hello upeksha,

Can you please share the path to the 'header.tpl' template on the filesystem?

Also you should certainly remove the / from your include call, it does not belong.

Cheers,
Heath

Monday 06 October 2014 5:40:45 am

Thank you very much.happy.gif Emoticon

path is design/standard/templates/header.tpl is the path .

when I call the template like {include uri='design:header.tpl'} after removing / it works. Thank you happy.gif Emoticon

when i include a template which is inside extension/ezmove/design/plain_site/override/templates/footer.tpl.  it doesn,t included corretly.Is there a specific location in ez publish to place a template to include?

Modified on Monday 06 October 2014 5:41:25 am by upeksha ranawaka

Monday 06 October 2014 1:55:41 pm

Hello upeksha,

First you should not modify the default designs (at all ever).

You should create a custom design extension and move your template into this path:

/path/to/ez/extension/customdesignextension/design/customdesign/templates/parts/header.tpl

Then in your template include use this:

{include uri='design:parts/header.tpl'}

Notice that include templates belong only (to my knowledge) in the templates folder and not in the override/templates folder which is why your second example fails to load correctly.

In the future only include templates in the templates/parts directory to be safe.

I hope this helps.

Cheers,
Heath 

Modified on Tuesday 07 October 2014 5:47:53 am by // Heath

Tuesday 07 October 2014 5:25:13 am

Hi,

Thank you very much.happy.gif Emoticon.I have solved my problem successfully with you'r help.happy.gif Emoticon

Tuesday 07 October 2014 5:48:41 am

Hello upeksha,

I'm glad I could help you find the solution!

Feel free to ask more questions by creating a new thread here in the forums.

Cheers,
Heath 

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from