カスタムフィールドの作成
カスタムフィールドはテキスト、テキストエリア、チェックボックス、ラジオボタン、セレクトなど用途に応じて作ることができ、お問い合わせフォームやエントリー作成画面、ブログ・カテゴリー・ユーザー・モジュールの管理画面で使います。
カスタムフィールドの記述について解説します。
テキストのカスタムフィールド
テキストを入力するカスタムフィールドを作ることができます。
サンプルHTML(カスタムフィールド変数名:furigana)
<tr>
<th>ふりがな</th>
<td>
<input type="text" name="furigana" value="{furigana}" class="acms-form-width-3quarters" />
<input type="hidden" name="field[]" value="furigana" />
</td>
</tr>テキストエリアのカスタムフィールド
テキストエリアを入力するカスタムフィールドを作ることができます。
サンプルHTML(カスタムフィールド変数名:inquiry)
<tr>
<th>お問い合わせ内容</th>
<td>
<textarea name="inquiry" class="acms-form-width-3quarters">{inquiry}</textarea>
<input type="hidden" name="field[]" value="inquiry" />
</td>
</tr>チェックボックスのカスタムフィールド
チェックボックスを入力するカスタムフィールドを作ることができます。 サンプルHTML(カスタムフィールド変数名:time)
<tr>
<th>時間帯</th>
<td>
<label>
<input type="checkbox" name="time[]" value="午前"{time:checked#午前} />
午前
</label>
<label>
<input type="checkbox" name="time[]" value="午後"{time:checked#午後} />
午後
</label>
<input type="hidden" name="field[]" value="time" />
</td>
</tr>ラジオボタンのカスタムフィールド
ラジオボタンを入力するカスタムフィールドを作ることができます。 サンプルHTML(カスタムフィールド変数名:gender)
<tr>
<th>性別</th>
<td>
<label><input type="radio" name="gender" value="男"{gender:checked#男} />男</label>
<label><input type="radio" name="gender" value="女"{gender:checked#女} />女</label>
<input type="hidden" name="field[]" value="gender" />
</td>
</tr>セレクトのカスタムフィールド
セレクトボックスを入力するカスタムフィールドを作ることができます。 サンプルHTML(カスタムフィールド変数名:type)
<tr>
<th>ご用件</th>
<td>
<select name="type">
<option value=""></option>
<option value="ご質問"{type:selected#ご質問}>ご質問</option>
<option value="資料請求"{type:selected#資料請求}>資料請求</option>
<option value="その他"{type:selected#その他}>その他</option>
</select>
<input type="hidden" name="field[]" value="type" />
</td>
</tr>