Skip to content

Commit bcfd4fa

Browse files
committed
Add ExampleScreenMacros file as example of macro override from a file inside a component rather than in the runtime directory
1 parent dc99d70 commit bcfd4fa

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

screen/ExampleApp/Example.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ along with this software (see the LICENSE.md file). If not, see
1717
default-menu-title="Example" default-menu-index="1">
1818

1919
<!-- this is a test, and example, of overriding the default FTL macro template to use for this screen -->
20-
<macro-template type="html" location="template/screen-macro/TestScreenHtmlMacros.ftl"/>
20+
<macro-template type="vuet" location="component://example/template/screen-macro/ExampleScreenMacros.vuet.ftl"/>
2121

2222
<subscreens default-item="FindExample"/>
2323

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<#--
2+
This software is in the public domain under CC0 1.0 Universal plus a Grant of Patent License.
3+
4+
To the extent possible under law, the author(s) have dedicated all
5+
copyright and related and neighboring rights to this software to the
6+
public domain worldwide. This software is distributed without any
7+
warranty.
8+
9+
You should have received a copy of the CC0 Public Domain Dedication
10+
along with this software (see the LICENSE.md file). If not, see
11+
<http://creativecommons.org/publicdomain/zero/1.0/>.
12+
-->
13+
14+
<#include "runtime://template/screen-macro/DefaultScreenMacros.vuet.ftl"/>
15+
16+
<#macro container>
17+
<#assign divId><@nodeId .node/></#assign>
18+
<${.node["@type"]!"div"}<#if divId?has_content> id="${divId}"</#if><#if .node["@style"]?has_content> class="${ec.resource.expand(.node["@style"], "")}"</#if>>
19+
<#recurse>
20+
</${.node["@type"]!"div"}><!-- CONTAINER OVERRIDE FOR THE Example.xml screen -->
21+
</#macro>

0 commit comments

Comments
 (0)