我正在使用Koken,并希望通过将日期放在条目的顶部来定制文本条目的模板。
我在核心模板文件/admin/templates/text.tmpl.html中修改了对new Date()的调用
<div id="entry-editor">
<div id="edit-area" data-bind="html: content() ||
'<p class=\'date\'>' + new Date() + '</p>
<p class=\'media-row\'><br /></p>'">
</div>
</div> <!-- close #entry-editor -->这工作得很好,但我知道黑客攻击核心文件的危险。
在写这篇文章的时候,我还没有在help.koken.me上看到一个链接为"define your own custom template types“的页面上的答案。
在不修改核心文件的情况下,我如何让Koken在每个文本条目的顶部添加日期?
发布于 2013-05-21 09:38:13
来自http://help.koken.me/customer/portal/questions/1080677-how-to-make-custom-templates-in-koken-
只需在customized theme模板中放置一个<koken:time>标记。
例如,在我的/storage/themes/<custom-theme-name>/essay.lens文件中:
<header>
<h2>
<koken:link>{{ essay.title }}</koken:link>
</h2>
<p>
<strong><koken:time show="time" /> <koken:time show="date" /></strong>
</p>
</header>https://stackoverflow.com/questions/16635929
复制相似问题