编辑该页面< / >或<一个href ="//www.szfbm.com/docs/documentation-feedback/">提个建议< / >< / div >发布版本< / h1 >
一篇文章或专著可能出版多个版本。应该构建一个主题,以确保始终显示正确的版本。
使用getCurrentPublication ()
获取一篇文章或专著最新出版版本的方法。
<标题>{$提交- > getCurrentPublication()——> getLocalizedFullTitle() |逃脱}< / h1 >< div >发表在<时间>{$提交- > getCurrentPublication()——> getData (datePublished) | date_format: $ dateFormatLong}< /时间>< / div >
最近发布的版本应该始终显示在列表中,例如问题内容表、目录页面和搜索结果。
<标题>文章< / h1 >{foreach从= $ = $提交项目提交}文章< >< h2 >{$提交- > getCurrentPublication()——> getLocalizedFullTitle() |逃脱}< / h2 >...< / >的文章{/ foreach}
用户可以查看文章或专著的旧版本。这个请求被传递给相同的article.tpl
显示最新版本的模板。当你为你的主题写这个模板时,出版
变量将包含请求的版本。
<标题>{$发布- > getLocalizedTitle |逃脱}< / h1 >
比较出版
到currentPublication
确定阅读器是否正在查看过期版本并显示警告。
{if $currentPublication->getId() !== $currentPublication->getId()}< div角色=“警告”>您正在查看这篇文章的旧版本。查看<一个href =“…”>最新版本< / >.< / div >{/如果}
获取最新版本的链接。
{url page="article" op="view" path=$article->getBestId()}
或者获得已发布的每个版本的链接。
{foreach from=$article->getData('publications') item=$iPublication} {url page="article" op="view" path=$article->getBestId()|to_array:"version":$iPublication->getId()} {/foreach}