トップ等での変数
トップ(/default/)で表示できる変数
※サイト全体を管理する場合のエントリー一覧(/enter/)やカテゴリー別一覧(/category/)でも表示
各エントリーの情報
変数 | 変数の内容 | 値 |
---|---|---|
{$entries} | エントリー情報 | 要 |smarty:nodefaults |
{$entry} | foreachで取得した各エントリー情報 |
各エントリーの情報は、
<!--{foreach from=$entries|smarty:nodefaults item='entry'}-->
各エントリーの情報
<!--{/foreach}-->
で表示される
データベースに格納される各エントリー情報({$entry.xxx})
値はエントリー格納テーブル(freo_entries)に準ずる。
変数 | 変数の内容 | 値/(NULL)は空白 |
---|---|---|
{$entry.id} | エントリーID | (数字) |
{$entry.user_id} | ユーザーID | (英数字) |
{$entry.created} | 新規登録日時 | 例:2015-01-01 21:18:00 |
{$entry.modified} | 最終更新日時 | 例:2015-01-01 21:18:00 |
{$entry.approved} | 承認 | yes:承認 no:未承認 |
{$entry.restriction} | 閲覧制限 | user:ユーザー登録で制限 group:グループで制限 password:パスワードで制限 (NULL):制限なし |
{$entry.password} | パスワード | (MD5変換) |
{$entry.status} | 状態 | publish:公開 private:非公開 future:予約投稿 |
{$entry.display} | 表示 | publish:初期画面に表示する private:初期画面に表示しない |
{$entry.comment} | コメントの受付 | open:受け付ける closed:受け付けない view:表示のみ user:登録ユーザーから受け付ける |
{$entry.trackback} | トラックバックの受付 | open:受け付ける closed:受け付けない view:表示のみ |
{$entry.code} | コード | (英数字) |
{$entry.title} | タイトル | |
{$entry.tag} | タグ | 例:タグ1,タグ2(複数の場合は「,」で区切りを表記) |
{$entry.datetime} | 日時 | 例:2015-01-01 21:18:00 |
{$entry.close} | 公開終了日時 | 例:2015-01-01 21:18:00 |
{$entry.file} | ファイル名 | 例:エントリーID.jpg |
{$entry.image} | イメージ名 | 例:エントリーID.jpg |
{$entry.memo} | ファイルの説明 | |
{$entry.text} | 本文 |
データベースに格納されない各エントリー情報({$entry_xxxs[$entry.id]})
※「xxxs」は「xxx」の複数形
カテゴリー
変数 | 変数の内容 | 値 |
---|---|---|
{$entry_associates[$entry.id].category} | 各$entry.idのカテゴリー情報 | |
{$entry_category} | foreachで取得したカテゴリーID | (英数字) |
※foreachで取得したカテゴリーID($entry_category)の各情報を取得する。値はカテゴリー格納テーブル(freo_categories)に準ずる。
変数 | 変数の内容 | 値 |
---|---|---|
{$freo.refer.categories[$entry_category].id} | ID | (英数字) |
{$freo.refer.categories[$entry_category].pid} | 親ID | (英数字) |
{$freo.refer.categories[$entry_category].created} | 登録日時 | 例:2015-01-01 21:18:00 |
{$freo.refer.categories[$entry_category].modified} | 更新日時 | 例:2015-01-01 21:18:00 |
{$freo.refer.categories[$entry_category].display} | 表示 | publish:初期画面に表示する private:初期画面に表示しない |
{$freo.refer.categories[$entry_category].sort} | 並び順 | (数字) |
{$freo.refer.categories[$entry_category].name} | カテゴリー名 | |
{$freo.refer.categories[$entry_category].memo} | 説明 |
※表記例
<!--{if $entry_associates[$entry.id].category}-->
<dl>
<dt>カテゴリー</dt>
<!--{foreach from=$entry_associates[$entry.id].category|smarty:nodefaults key='entry_category' item='entry_category' name='loop'}-->
<dd><a href="{$freo.core.http_file}/category/{$entry_category}">{$freo.refer.categories[$entry_category].name}</a></dd>
<!--{/foreach}-->
</dl>
<!--{/if}-->
上記の場合、HTML表示は
<dl>
<dt>カテゴリー</dt>
<dd><a href="http://www.example.com/freo/category/category1">カテゴリー1</a></dd>
<dd><a href="http://www.example.com/freo/category/category2">カテゴリー2</a></dd>
</dl>
のようになる
タグ
変数 | 変数の内容 | 備考 |
---|---|---|
{$entry_tags[$entry.id]} | 各$entry.idのタグ情報 | |
{$entry_tag} | foreachで取得した各タグ情報 |
※表記例
<!--{if $entry_tags[$entry.id]}-->
<dl>
<dt>タグ</dt>
<!--{foreach from=$entry_tags[$entry.id]|smarty:nodefaults item='entry_tag' name='loop'}-->
<dd><a href="{$freo.core.http_file}/entry?tag={$entry_tag|smarty:nodefaults|escape:'url'}">{$entry_tag}</a></dd>
<!--{/foreach}-->
</dl>
<!--{/if}-->
上記の場合、HTML表示は
<dl>
<dt>タグ</dt>
<dd><a href="http://www.example.com/freo/entry?tag=タグ1">タグ1</a></dd>
<dd><a href="http://www.example.com/freo/entry?tag=タグ2">タグ2</a></dd>
</dl>
のようになる
オプション
変数 | 変数の内容 | 値 |
---|---|---|
{$entry_associates[$entry.id].option} | 各$entry.idのオプション情報 | |
{$freo.refer.options} | オプション情報 | |
{$option} | foreachで取得した各オプション情報 | |
{$entry_associates[$entry.id].option[$option.id]} | 各$entry.idの各$option.idの登録内容 | option.typeがfile⇒ファイル名 |
※foreachで取得した各オプション($option)の各情報を取得する。値はオプション格納テーブル(freo_options)に準ずる。
変数 | 変数の内容 | 値 |
---|---|---|
{$option.id} | ID | |
{$option.created} | 登録日時 | |
{$option.modified} | 更新日時 | |
{$option.target} | 利用対象 | entry:エントリー page:ページ (NULL):すべて |
{$option.type} | 種類 | text:一行入力 textarea:複数行入力 select:セレクトボックス radio:ラジオボタン checkbox:チェックボックス file:アップロード |
{$option.required} | 必須 | yes:入力必須 no:任意 |
{$option.validate} | 検証 | numeric:数値のみ alphabet:英数字のみ (NULL):なし |
{$option.sort} | 並び順 | (数字) |
{$option.name} | オプション名 | |
{$option.memo} | 説明 | |
{$option.text} | 初期値 |
※表記例
<!--{if $entry_associates[$entry.id].option}-->
<dl>
<!--{foreach from=$freo.refer.options|smarty:nodefaults item='option'}-->
<!--{if $entry_associates[$entry.id].option[$option.id] != ''}-->
<dt>{$option.name}</dt>
<dd>
<!--{if $option.type == 'file'}-->
<a href="{$freo.core.http_url}{$smarty.const.FREO_FILE_DIR}entry_options/{$entry.id}/{$option.id}/{$entry_associates[$entry.id].option[$option.id]}">{$entry_associates[$entry.id].option[$option.id]}</a>
<!--{else}-->
{$entry_associates[$entry.id].option[$option.id]|nl2br}
<!--{/if}-->
</dd>
<!--{/if}-->
<!--{/foreach}-->
</dl>
<!--{/if}-->
上記の場合、HTML表示は
<dl>
<dt>オプション1</dt>
<dd>
<a href="http://www.example.com/freo/entry_options/1/option1/option.jpg">option.jpg</a>
</dd>
<dt>オプション2</dt>
<dd>
オプション2の事項
</dd>
</dl>
のようになる
添付ファイル
変数 | 変数の内容 | 値 |
---|---|---|
{$entry_files[$entry.id].width} | 添付ファイル(画像)の幅 | (数字) |
{$entry_files[$entry.id].height} | 添付ファイル(画像)の高さ | (数字) |
{$entry_files[$entry.id].size} | 添付ファイルの容量 | (数字) |
{$freo.core.http_url}{$smarty.const.FREO_FILE_DIR}entry_files/{$entry.id}/{$entry.file} | 添付ファイルのURL | 例:http://www.example.com/freo/files/entry_files/1/1.jpg ※設置URL/files/entry_files/エントリーID/エントリーID.jpg |
{$entry_thumbnails[$entry.id].width} | サムネイルの幅 | (数字) |
{$entry_thumbnails[$entry.id].height} | サムネイルの高さ | (数字) |
{$entry_thumbnails[$entry.id].size} | サムネイルの容量 | (数字) |
{$freo.core.http_url}{$smarty.const.FREO_FILE_DIR}entry_thumbnails/{$entry.id}/{$entry.file} | サムネイルのURL | 例:http://www.example.com/freo/files/entry_thumbnails/1/1.jpg ※設置URL/files/entry_thumbnails/エントリーID/エントリーID.jpg |
添付イメージ
変数 | 変数の内容 | 値 |
---|---|---|
{$entry_images[$entry.id].width} | 添付イメージの幅 | (数字) |
{$entry_images[$entry.id].height} | 添付イメージの高さ | (数字) |
{$entry_images[$entry.id].size} | 添付イメージの容量 | (数字) |
{$freo.core.http_url}{$smarty.const.FREO_FILE_DIR}entry_images/{$entry.id}/{$entry.image} | 添付イメージのURL | 例:http://www.example.com/freo/files/entry_images/1/1.jpg ※設置URL/files/entry_images/エントリーID/エントリーID.jpg |
エントリー本文
変数 | 変数の内容 | |
---|---|---|
{$entry_texts[$entry.id].excerpt|smarty:nodefaults} | エントリー本文 | 要 |smarty:nodefaults |
{$entry_texts[$entry.id].more|smarty:nodefaults} | エントリー本文(続きの部分) | 要 |smarty:nodefaults |
※|smarty:nodefaultsをつけてHTMLを反映させる必要あり
セキュリティ
変数 | 変数の内容 | 値 |
---|---|---|
{$entry_securities[$entry.id]} | 閲覧制限時のセキュリティ | 1:制限中 (NULL):認証済もしくは制限しない |
※ここに載っていない情報が何かあれば...情報を追加・編集する
※編集は面倒・やり方が分からない場合は、コメント欄に書いていただければ有志の方で編集します。
- 最終更新:2016-06-18 22:33:17