|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
tani Smarty n00b
Joined: 16 May 2013 Posts: 1
|
Posted: Thu May 16, 2013 4:47 am Post subject: How to load the content of parent template to child template |
|
|
I have a header template consisting of the main menu. On the basis of selection of the menu item, I have to load another content without affecting the header.tpl or reloading it.
I have tried template inheritance, but whenever i display child.tpl, the parent.tpl reloads. Please explain me how to load the content of child.tpl without reloading header.tpl.
header.tpl
Code: | <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<head></head>
<body>
{block name="content"}
{$smarty.block.child}
{/block}
</body>
</html> |
child.tpl
Code: | {extends file="header.tpl"}
{block name="content"}
<div id="container">
<div id="content">
<div class="contentheader">
<p>Create Item</p>
</div>
</div>
</div>
{/block} |
index.php
Code: | $smarty->display('child.tpl'); |
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|