如何将瓷砖留空
是否可以将一块瓷砖留空?假设一个页面中有三个图块:页眉、正文、页脚。我可以简单地添加正文和页脚并将页眉留空吗?
<body class="claro">
<div id="wrapper">
<div id="container" class="container">
<div id="hd">
<tiles:insertAttribute name="header" />
</div>
<div id="bd">
<hr/>
<tiles:insertAttribute name="body" />
</div>
<div id="ft">
<hr/>
<tiles:insertAttribute name="footer" />
</div>
</div>
</div>
所以我想像这样使用一次:
<definition name="base" template="...">
<put-attribute name="header" value="/WEB-INF/views/base/header.jspx" />
<put-attribute name="body" value="/WEB-INF/views/base/body.jspx" />
<put-attribute name="footer" value="/WEB-INF/views/base/footer.jspx" />
</definition>
并且像这样使用一次:
<definition name="base" template="...">
<put-attribute name="body" value="/WEB-INF/views/base/body.jspx" />
<put-attribute name="footer" value="/WEB-INF/views/base/footer.jspx" />
</definition>
目前第二次使用爆炸了。说我还没有定义标题。
有办法做到这一点吗?
Is it possible to leave a tile empty? Let's say I have three tiles in a page: header, body, footer. Can i simply add a body and a footer and leave header empty?
<body class="claro">
<div id="wrapper">
<div id="container" class="container">
<div id="hd">
<tiles:insertAttribute name="header" />
</div>
<div id="bd">
<hr/>
<tiles:insertAttribute name="body" />
</div>
<div id="ft">
<hr/>
<tiles:insertAttribute name="footer" />
</div>
</div>
</div>
So I want to use this once like this :
<definition name="base" template="...">
<put-attribute name="header" value="/WEB-INF/views/base/header.jspx" />
<put-attribute name="body" value="/WEB-INF/views/base/body.jspx" />
<put-attribute name="footer" value="/WEB-INF/views/base/footer.jspx" />
</definition>
And once like this :
<definition name="base" template="...">
<put-attribute name="body" value="/WEB-INF/views/base/body.jspx" />
<put-attribute name="footer" value="/WEB-INF/views/base/footer.jspx" />
</definition>
Currently the second usage blows up. Saying i haven't defined header.
Is there a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用ignore属性:
根据docs:
Use the ignore attribute:
According to the docs:
您可以只在基本定义中提供一个空的标题页,然后在更具体的定义中替换正文和页脚。
您也可以将该值设置为空字符串:
You could just provide an empty header page in a base definition and then replace body and footer in the more specific ones.
You could also just set the value to an empty string: