【baserCMS:初心者向け】ページごとの分岐方法
ページごとの分岐方法
スラッグがworkのページのみに表示したいコンテンツがある場合
<?php if (strtolower($this->BcBaser->getContentsName()) === 'work'): ?>
〜コンテンツ〜
<?php endif; ?>
スラッグがworkのページのみに表示したくないコンテンツがある場合(work以外のページに表示)
<?php if (strtolower($this->BcBaser->getContentsName(true)) !== 'work'): ?>
〜コンテンツ〜
<?php endif; ?>
複数ページ分岐
スラッグがpolicyとfaqのページ以外のページで表示したいコンテンツがある場合
<?php
$slug = strtolower($this->BcBaser->getContentsName(true));
if ($slug !== 'policy' && $slug !== 'faq'): ?>
〜コンテンツ〜
<?php endif; ?>
Author And Source
この問題について(【baserCMS:初心者向け】ページごとの分岐方法), 我々は、より多くの情報をここで見つけました https://qiita.com/nomag/items/4a9e6a31f8b261ef54b1著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .