0

Koken を使用していますが、テキスト エントリのテンプレートをカスタマイズして、エントリの先頭に日付を配置したいと考えています。

new Date()コア テンプレート ファイルへの呼び出しをハッキングしました/admin/templates/text.tmpl.html

<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の「独自のカスタム テンプレート タイプを定義する」としてリンクされているページに回答がありません。

コア ファイルをハッキングせずに、どうすれば Koken に各テキスト エントリの先頭に日付を追加させることができますか?

4

1 に答える 1

0

http://help.koken.me/customer/portal/questions/1080677-how-to-make-custom-templates-in-koken-より

カスタマイズされたテーマテンプレート<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>
于 2013-05-21T01:38:12.530 に答える