怎么在html模板中添加文章,如何在网页内容模板中获取标题、版本、作者等信息 | IT人生录...

在Liferay的网页内容模板中,我们可以方便的获取自定义的结构的字段的内容,但是有时候我们想要获取作者、标题、发布日期、版本、缩略图等信息时,却感觉找不到信息,Liferay有内置的提供,只不过很少有文档说明。

在Velocity模板中

$reserved-article-id.data

$reserved-article-version.data

$reserved-article-title.data

$reserved-article-create-date.data

$reserved-article-modified-date.data

$reserved-article-display-date.data

$reserved-article-small-image-url

$reserved-article-description

$reserved-article-asset-tag-names

$reserved-article-author-id

$reserved-article-author-name

$reserved-article-author-email-address

$reserved-article-author-comments

$reserved-article-author-organization

$reserved-article-author-location

在FreeMarker模板中

如果是在FreeMarker模板中使用如下的代码:

${.vars['reserved-article-title'].data}

其他的都类似,就不在这里一一说明。

这些字段是在哪里定义的?

可以在源码的JournalStructureConstants类里面找到定义,在JournalUtil类里面进行写入的。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值