個人用ツール

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

提供: baserCMS公式ガイド

移動: 案内, 検索
(1版 : 関数リファレンス→ver4)
 
(同じ利用者による、間の1版が非表示)
行2: 行2:
  
 
## 説明
 
## 説明
キーワード用のメタタグを出力します。
+
キーワード用のメタタグを出力する。<br>
 
+
コンテンツテンプレート側で何も指定がない場合は<br>
コンテンツテンプレート側で何も指定がない場合は、管理画面のサイト基本設定で指定されたサイト基本キーワードを出力します。
+
'''管理画面 > システム管理 > サイト基本キーワード''' に指定されているキーワードを出力します。
  
 
## 使い方
 
## 使い方
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
$this->BcBaser->metaKeywords();
+
<?php $this->BcBaser->metaKeywords(); ?>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
## 用例
 
## 用例
 
### 基本
 
### 基本
 +
キーワードメタタグを出力する。
 
####コード
 
####コード
コンテンツテンプレート側で何も指定がない場合
 
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
 
<?php $this->BcBaser->metaKeywords(); ?>
 
<?php $this->BcBaser->metaKeywords(); ?>
行21: 行21:
 
####出力
 
####出力
 
<syntaxhighlight lang="html5">
 
<syntaxhighlight lang="html5">
'管理画面のサイト基本設定で指定されたサイト基本キーワード'
+
<meta name="keywords" content="baser,CMS,コンテンツマネジメントシステム,開発支援">
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
### 応用
 
### 応用
 +
キーワードを個別に指定する。<br>
 +
コンテンツテンプレートに下記の1行を記述した後に出力関数を記述します。
 
####コード
 
####コード
個別に指定する場合は、コンテンツテンプレートに下記の1行を記述します。
 
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
<?php $this->BcBaser->setKeywords('キーワードテキスト'); ?>
+
<?php $this->BcBaser->setKeywords('個別に指定したいキーワード'); ?>
 +
<?php $this->BcBaser->metaKeywords(); ?>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
####出力
 
####出力
 
<syntaxhighlight lang="html5">
 
<syntaxhighlight lang="html5">
キーワードテキスト
+
<meta name="keywords" content="個別に指定したいキーワード">
 
</syntaxhighlight>
 
</syntaxhighlight>
 
## 注
 
 
## 変更履歴
 
 
## ソースファイル
 
 
## 関連資料
 
  
 
##類似の関数
 
##類似の関数
 
+
- [getKeywords](/ver4/関数リファレンス/getKeywords) - meta タグ用のキーワードを取得する
[[Category:関数リファレンスver4]]
+
- [getDescription](/ver4/関数リファレンス/getDescription) - meta タグ用のページ説明文を取得する
 +
- [metaDescription](/ver4/関数リファレンス/metaDescription) - ページ説明文用のメタタグを出力する

2018年12月21日 (金) 02:07時点における最新版

[このコンテンツは内容調整中です]

説明

キーワード用のメタタグを出力する。
コンテンツテンプレート側で何も指定がない場合は
管理画面 > システム管理 > サイト基本キーワード に指定されているキーワードを出力します。

使い方

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

用例

基本

キーワードメタタグを出力する。

コード

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

出力

<meta name="keywords" content="baser,CMS,コンテンツマネジメントシステム,開発支援">

応用

キーワードを個別に指定する。
コンテンツテンプレートに下記の1行を記述した後に出力関数を記述します。

コード

<?php $this->BcBaser->setKeywords('個別に指定したいキーワード'); ?>
<?php $this->BcBaser->metaKeywords(); ?>

出力

<meta name="keywords" content="個別に指定したいキーワード">

類似の関数

  • getKeywords - meta タグ用のキーワードを取得する
  • getDescription - meta タグ用のページ説明文を取得する
  • metaDescription - ページ説明文用のメタタグを出力する