個人用ツール

「関数リファレンス/BcBaser getTitle」の版間の差分

提供: baserCMS公式ガイド

移動: 案内, 検索
行1: 行1:
 
## 説明  
 
## 説明  
コンテンツタイトルと(カテゴリ)、ページタイトルを出力します。
+
タイトルタグを取得する。<br />
 +
metaタグ用のタイトルを返す。
 +
 
 +
ページタイトルと直属のカテゴリ名が同じ場合は、ページ名を省略します。
  
 
## 使い方
 
## 使い方
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
echo $this->BcBaser->getTitle( [$separator] , [$categoriTitleOn] )
+
$this->BcBaser->getTitle( [$separator] , [$categoriTitleOn] )
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
## パラメータ
 
## パラメータ
 
$separator
 
$separator
: コンテンツタイトルとページタイトルの間のセパレーターを出力
+
: コンテンツタイトルとページタイトルの間のセパレーターを指定する
 
: 初期値は'|'(縦棒)
 
: 初期値は'|'(縦棒)
  
行25: 行28:
 
####コード
 
####コード
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
<?php echo $this->BcBaser->getTitle();  ?>
+
<?php $this->BcBaser->getTitle();  ?>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
####出力
+
####取得
 
<syntaxhighlight lang="html5">
 
<syntaxhighlight lang="html5">
 
コンテンツタイトル  | (カテゴリ |) ページタイトル
 
コンテンツタイトル  | (カテゴリ |) ページタイトル
行39: 行42:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
####出力
+
####取得
 
<syntaxhighlight lang="html5">
 
<syntaxhighlight lang="html5">
 
コンテンツタイトル  / ページタイトル
 
コンテンツタイトル  / ページタイトル

2014年11月7日 (金) 18:28時点における版

説明

タイトルタグを取得する。
metaタグ用のタイトルを返す。

ページタイトルと直属のカテゴリ名が同じ場合は、ページ名を省略します。

使い方

$this->BcBaser->getTitle( [$separator] , [$categoriTitleOn] )

パラメータ

$separator
コンテンツタイトルとページタイトルの間のセパレーターを指定する
初期値は'|'(縦棒)
$categoriTitleOn
カテゴリタイトルの出力の有無を指定する
初期値:true
booleanで指定

戻り値

(string)
コンテンツタイトル 【セパレータ】 カテゴリ 【セパレータ】 ページタイトル

用例

基本

コード

<?php $this->BcBaser->getTitle();  ?>

取得

コンテンツタイトル  | (カテゴリ |) ページタイトル

応用

コード

<?php echo $this->BcBaser->getTitle('/', false); ?>

取得

コンテンツタイトル  / ページタイトル

(カテゴリーが出力されない)

変更履歴

ソースファイル

関連資料

類似の関数

getImg