Twitter Feed

Xataface Maillist

Sign up to receive the Xataface news letter with weekly updates and development tips.

 
Found 1 of 138 records in table Wiki
Now Showing 1 of 1

Current Record: templates:tags:use_macro

templates:tags:use_macro

[Permalink]

use_macro Template Tag

Synopsis

The use_macro tag includes another template into the current template with the option to override certain sections.

Parameters

Name Description Version
file The path the template to include (within the templates directory). 0.6

Example

In this example we will create a template for a user profile, but this template will include a slot that can be overridden by other templates to customize the user bio.

user-profile.html

<html>
<head>
    <title>User profile</title>
</head>
<body>
   <h1>User bio</h1>
   <div id="bio">
   {define_slot name="bio"}
        This text will be overridden by other templates to place the correct
        bio information.
   {/define_slot}
</body>
</html>

steve-profile.html

{use_macro file="user-profile.html"}
    {fill_slot name="bio"}
        This is Steve's bio.  It will override the text in the bio slot.
    {/fill_slot}
{/use_macro}

See also:

blog comments powered by Disqus
Powered by Xataface
(c) 2005-2018 All rights reserved