如何在 Velocity 模板中创建面包屑
我正在尝试为包含面包屑的横幅创建自定义速度模板,但不知道如何进行。我注意到portal_normal.vm 中#breadcrumb() 的行看起来像Velocity 宏,但我找不到尝试复制它的宏。
有什么想法吗?
I'm trying to create a custom Velocity Template for a banner which includes a breadcrumb but have no idea how to go about it. I've noticed the line which says #breadcrumb() in portal_normal.vm looks like a Velocity macro, but I cannot find the macro to try and replicate this.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在门户的源代码中的文件 portal-impl\src\VM_liferay.vm 中找到它。
它定义为:
You can find it in source code of portal, in file portal-impl\src\VM_liferay.vm.
It is defined as:
整个门户的高级布局位于portal_normal.vm 中,至少在6.1 中是这样。 calssic 主题由标题、内容和页脚的 div 标签组成。横幅位于
块之间。因此,您可能只需将其移动
到该块内的正确位置即可。
您还可以使用命令将速度宏划分为多个文件
,我刚刚就是这么做的:) 例如。我为页眉、内容和页脚制作了自己的文件。
The highlevel layout of the whole portal is in the portal_normal.vm, which atleast in 6.1. calssic theme consists of div tags for heading, content and footer. The banner is between the
block. So you probably only need to move the
to the right place inside that block.
You could also divide the velocity macros to multiple files with
commands, which I just did :) Eg. I made own file for header, content and footer.