LoginSignup
0
1

More than 5 years have passed since last update.

[Drupal7]コンテンツページにタクソノミー関連コンテンツを表示する

Last updated at Posted at 2017-10-23

コンテンツページに関連記事を表示する覚書

ページのサイドに関連記事を表示する。Views,Blockモジュールを使用。

Views

1) + Add new view
2) View name [Related Contents] -> Create a page : off / Create a block : on -> Continue & edit
3) Block Settings
Display name [Related Contents Block]
PAGER Use pager : Display all items | All items

4) Advanced/CONTEXTUAL FILTERS Add -> コンテンツ: Has taxonomy term ID
WHEN THE FILTER VALUE IS NOT AVAILABLE
・Provide default value:type / Taxonomy term ID from URL
以下画像参照
image.png

※複数のタクソノミーを選択する場合、[Reduce duplicates]と[Allow multiple values]オプションをチェック

4) Current(表示中のページ)をリストから除外する
Advanced/CONTEXTUAL FILTERS Add -> コンテンツ: Nid
WHEN THE FILTER VALUE IS NOT AVAILABLE
・Provide default value:type / Content ID from URL
image.png
一番下の「続き」の中にある[Exclude]オプションをチェック

Block

1) 関連コンテンツを表示したいブロックに [View: Related contents: Related Contents Block]を選択

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1