按 portlet 类型自定义 portlet.vm 模板?
有没有办法根据 Liferay Portal 6.0.6 中的 portlet 类型提供自定义 portlet.vm-template? 像 search-portlet.vm 和 sitemap-portlet.vm 这样的东西还是必须在任何 XML 配置文件中指定(在 portlet 本身或主题中)?
Is there a way to provide an custom portlet.vm-template based on the portlet type in Liferay Portal 6.0.6?
Something like search-portlet.vm and sitemap-portlet.vm or does it have to specified in any XML config-files (in the portlet itself or in the theme)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道这是可声明的,但您应该能够在模板中访问
$portletDisplay.getId()
(或类似的)并从那里继续。然而,根据设计,您不应该以这种方式向 portlet 添加太多设计 - 您还可以通过 CSS 实现不同的外观和感觉,从而解决不同的 portlet(所有 portlet 都有基于其 portlet 名称/id 的特定类)
portlet.xml 的经典用途是为所有 portlet 提供重复的装饰,因此统一为所有门户提供共同的外观和感觉。
I'm not aware of this being declarable, but you should be able to access
$portletDisplay.getId()
(or similar) in your template and continue from there.However, by design you shouldn't add too much design to the portlets this way - you can also achieve a different look&feel through CSS, addressing the different portlets (all of them have specific classes based on their portlet-name/id)
The classic use for portlet.xml is to provide the repetitive decoration for all portlets, so having this uniformly provides a common look&feel for all of the portal.