Re: Multiple layout section override ?
Tony Schwartz <[email protected]> Sat, 09 Mar 2013 08:13:47 -0500
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Organization | Iteration Software, LLC |
| Message-ID | <8e2327b758fca2784c2565157581d2c5@localhost> |
Sorry about that previous post! I accidentally sent the email, I just love
coding in a bad browser based email client!
What I have done in the past is this:
<#-- DEFINE THE MACRO -->
<#macro layout>
<html>
<body>
<div id="head"><#nested "head" /></div>
<div id="content"><#nested "content" /></div>
</body>
</html>
</#macro>
<#-- NOW, CALL THE MACRO -->
<@layout ; section>
<#if section = "head">
Write your header section here.
<#elseif section = "content" >
Write your content section here.
<#else>
Unsupported section??
</#if>
</@layout>
On Sat, 09 Mar 2013 08:09:05 -0500, Tony Schwartz
<[email protected]> wrote:
> What I have done is this:
>
> <#macro layout>
> <html>
> <body>
> </body>
>
> </#macro>
>
>
>
>
> On Wed, 6 Mar 2013 20:46:26 +0700, Albert Kam wrote: I am aware that i
> can use macros for layouting, for example, a main layout that contains
> header, left body section, center body section, footer.
> Based on the examples i have googled, like this one here
>
http://wendefer.blogspot.com/2007/09/handy-tip-for-layouts-in-freemarker.html
> [1], i can use in the main layout for dynamic values for other templates
> that use this main layout macro.
> But in my case, i would like the other templates to be able to
'override'
> more than 1 , for example, providing the content of left body section
-and-
> center body section (like apache tiles).
> Is this supported, or maybe is there any other approaches to do this ?
>
> --
> Do not pursue the past. Do not lose yourself in the future.
> The past no longer is. The future has not yet come.
> Looking deeply at life as it is in the very here and now,
> the practitioner dwells in stability and freedom.
> (Thich Nhat Hanh)
>
> Tony Schwartz
> [email protected]
>
>
> Links:
> ------
> [1]
>
http://wendefer.blogspot.com/2007/09/handy-tip-for-layouts-in-freemarker.html
--
Tony Schwartz
[email protected]
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev