Templatevar: smartbody
Examines the current item and then decides to show either the body text or the expanded text.
When the extended part is empty,the body part is chosen. Otherwise the extended part is shown.
| Part | Empty? | |
|---|---|---|
| Body | No | No |
| Extended | Yes | No |
| smartbody= | body part | extended part |
Example use
The body text could be interpreted as your full text,and the extended part could be interpreted as an "introduction" or "exerpt",which you want to show on the front page.
In the template used on the front page,you would use <%smartbody%> to insert an excerpt (if there is one),or the full text (if no excerpt). In the template for detailed items,<%body%> can then be used instead of the usual <%body%> + <%more%>,since <%body%> will contain the full item anyway.
テンプレート変数:smartbody
現在のアイテムを調べてから、「本文」と「続き」のどちらを表示するか決定します。
「続き」に何かが入力されていれば「続き」が、何も入力されていなければ「本文」が挿入されます。
| 部分名 | 何か入力されている? | |
|---|---|---|
| 本文 | 入力あり | 入力あり |
| 続き | 入力なし | 入力あり |
| smartbodyで 挿入される部分 | 「本文」部分 | 「続き」部分 |
使用例
「本文」に詳しい内容を入力し、「続き」には"紹介"、"抜粋"といった内容のものを入力し、「メインの目次ページ」で使用するテンプレートには<%smartbody%>を使い、抜粋が存在するときにはそれを、無い時は「本文」を使用するような使い方をします。
この時、「個別アイテムページ」で使うテンプレートには、 <%body%> + <%more%>のかわりに<%body% >だけを記述するようにすると、より効果的に使えるでしょう。
コメント送信
Nucleusをご利用いただき、ありがとうございます。ヘルプファイルの内容について気がついた事がございましたら、コメントフォームよりご連絡ください。
いただきましたコメントは、次期バージョンの「オンラインヘルプ」に反映させてまいります。
なお、コチラでは個別対応は出来ませんので、疑問点などございましたら、サポートフォーラムへ投稿をお願いいたします。
コメント
gblsm (2012年03月10日 22:22:34)
〜のかわりに<%body% >だけを〜
の閉じる「>」の直前に余分な半角スペースがあります。
Item ID:193