开发者

Is there a way to put javax.portlet.title elements in <h2> tags?

I'm currently writing a portlet which gets deployed into liferay.

I show the portlet's frame including its portlet-title element. My problem is that I can't put any tags around this title element. (I have a resource bundle attached to that portlet holding such an entry: javax.portlet.title=My fancy title without h2 tag)

It would be nice to have exactly that title wrapped by a h2 tag. Simply writing it into the resource bundle does not work, it seems that html is escaped. Writing javax.portlet.title=<h2>My fancy title</h2> shows me exactly that string on the website.

Any ideas? T开发者_高级运维hanks.


The portlet title is displayed (and the frame surrounding the portlet) is generated in portlet.vm, which is a file located in your theme. There it's, by default, generated with <h1>

<h1 class="portlet-title">
    $theme.iconPortlet() <span class="portlet-title-text">$portlet_title</span>
</h1>

If you could inject <h2> the way you mention, it would result in <h1><h2>My fancy title</h2></h1> (ignoring the icon here) due to that template

So: I guess you have your own theme, go there, override the file given. It's short, you can intuitively find the code you need to change there without problems.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜