Current Record: templates:tags:use_macro #24

use_macro Template Tag Synopsis The use_macro tag includes another template into the current template with the option to override certain ...

Current Record: templates:tags:use_macro #24

use_macro Template Tag Synopsis The use_macro tag includes another template into the current template with the option to override certain ...

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-2024 All rights reserved