OSDN Git Service

テンプレートのタイトル出力を修正。
authornaoki hirata <naoki@magic3.org>
Thu, 22 Feb 2018 05:00:51 +0000 (14:00 +0900)
committernaoki hirata <naoki@magic3.org>
Thu, 22 Feb 2018 05:00:51 +0000 (14:00 +0900)
include/mos/JRender.php

index b5efe0d..f557971 100644 (file)
@@ -185,16 +185,16 @@ class JRender extends JParameter
                $this->pageheading = '';                // ページタイトル用
                
                // ページタイトルの設定
-               if (!empty($title) && $title != M3_TAG_START . M3_TAG_MACRO_NOTITLE . M3_TAG_END){
-                       // 旧タイトル設定方法
-/*                     $this->params->set('show_title', 1);
+               if (!empty($title) && $title != M3_TAG_START . M3_TAG_MACRO_NOTITLE . M3_TAG_END){              // ウィジェットタイトルが設定されている場合
+/*                     // 旧タイトル設定方法
+                       $this->params->set('show_title', 1);
                        //$this->params->set('link_titles', 1);
                        $this->article->title = $title;
                        
                        // Joomla!2.5テンプレート用追加設定(2012/4/4 追加)
                        $this->item->title = $title;
                        $this->item->params->set('show_title', 1);
-                       */
+*/
                        // ページタイトルの設定方法を以下に変更(2015/10/6)
                        // Joomla!新型描画処理用(Joomla!1.5以上、Themler)
                        $this->params->set('show_page_heading', 1);
@@ -274,8 +274,8 @@ $this->item->title = '****';*/
                                if (!empty($viewData)){
                                        $contentItems = $viewData['Items'];             // コンテンツ情報
                                        $contentItem = $contentItems[0];
-                                       $this->item->title = $contentItem->title;
-                                       $this->item->params->set('show_title', 1);
+//                                     $this->item->title = $contentItem->title;                       // タイトルは非表示にしてページタイトルで表示?(2018/2/22)
+//                                     $this->item->params->set('show_title', 1);
 //                                     $this->item->titleLink = $contentItem->url;
 //                                     $this->item->params->set('link_titles', 1);             // リンク表示
                                        if (!empty($contentItem->published)){           // 登録日時
@@ -290,6 +290,13 @@ $this->item->title = '****';*/
                                                $this->item->hits = $contentItem->hits;
                                                $this->item->params->set('show_hits', 1);
                                        }
+                                       
+                                       // ##### Joomla!新型描画処理用(Joomla!1.5以上、Themler) #####
+                                       // ウィジェット側で設定したタイトルを使用の場合
+                                       if ($title == M3_TAG_START . M3_TAG_MACRO_NOTITLE . M3_TAG_END){
+                                               $this->params->set('show_page_heading', 1);
+                                               $this->params->set('page_heading', $contentItem->title);
+                                       }
                                }
 
                                $path = $gEnvManager->getTemplatesPath() . '/' . $templateId . '/html/com_content/article/default.php';         // ビュー作成処理