// ウィジェット生成
$widgetTag = self::WIDGET_TAG_HEAD . $position . '_' . ($i + 1); // ウィジェット識別用ユニークタグ
- $widgetContent = $render->getModuleContents($style, $widgetContent, $title, $attr, $params, $pageDefParam, $templateVer, $widgetTag);
+
+ if (strcmp($position, 'main') == 0){// メイン部のとき
+ $widgetContent = $render->getComponentContents($style, $widgetContent, $title, $attr, $params, $pageDefParam, $templateVer, $widgetTag);
+ } else {
+ $widgetContent = $render->getModuleContents($style, $widgetContent, $title, $attr, $params, $pageDefParam, $templateVer, $widgetTag);
+ }
// ウィジェット共通のコンテンツ処理
// $widgetContent = $this->_addOptionContent($widgetContent, $pageDefParam);
DELETE FROM _site_def WHERE sd_id = 'head_title';
INSERT INTO _site_def
(sd_id, sd_language_id, sd_value, sd_name) VALUES
-('site_name', 'ja', 'ブログサンプル', 'サイト名'),
+('site_name', 'ja', 'Magic3ブログサンプル', 'サイト名'),
('site_slogan', 'ja', 'WordPressテンプレートテスト中', 'スローガン'),
-('head_title', 'ja', 'ブログサンプル', 'HTMLヘッダtitle');
+('head_title', 'ja', 'Magic3ブログサンプル', 'HTMLヘッダtitle');
-- 管理画面ページデータ(デフォルトを変更)
UPDATE _page_id SET pg_default_sub_id = 'blog' WHERE pg_id = 'index' AND pg_type = 0;
{
}
/**
- * WordPressã\82¦ã\82£ã\82¸ã\82§ã\83\83ã\83\88用コンテンツ取得
+ * WordPressã\83¢ã\82¸ã\83¥ã\83¼ã\83«用コンテンツ取得
*
* @param string $style 表示スタイル
* @param string $content ウィジェット出力
return $content;
}
-
+ /**
+ * WordPressコンポーネント用コンテンツ取得
+ *
+ * @param string $style 表示スタイル
+ * @param string $content ウィジェット出力
+ * @param string $title タイトル(空のときはタイトル非表示)
+ * @param array $attribs その他タグ属性
+ * @param array $paramsOther その他パラメータ
+ * @param array $pageDefParam 画面定義パラメータ
+ * @param int $templateVer テンプレートバージョン(0=デフォルト(Joomla!v1.0)、-1=携帯用、1=Joomla!v1.5、2=Joomla!v2.5)
+ * @param string $widgetTag ウィジェット識別用タグ
+ * @return string モジュール出力
+ */
+ public function getComponentContents($style, $content, $title = '', $attribs = array(), $paramsOther = array(), $pageDefParam = array(), $templateVer = 0, $widgetTag = '')
+ {
+ global $gEnvManager;
+
+ // コンポーネント生成用スクリプトパス取得
+ $componentPath = $gEnvManager->getWpComponentPath();
+ if (file_exists($componentPath)){
+ ob_clean();
+ require($componentPath); // 毎回実行する
+ $content = ob_get_contents();
+ ob_clean();
+ } else {
+ // コンポーネント生成用スクリプトがない場合はWordPressモジュール出力を使用
+ $content = $this->getModuleContents($style, $content, $title, $attribs, $paramsOther, $pageDefParam, $templateVer, $widgetTag);
+ }
+ return $content;
+ }
}
?>
return;
}*/
- if ($wp_query->current_post == 0) echo $gPageManager->getWPContents('main-top');
+ if ($wp_query->in_the_loop && $wp_query->current_post == 0) echo $gPageManager->getWPContents('main-top');
/**
* Fires before the specified template part file is loaded.
// ##### メインエリア生成 #####
// ページのコンテンツタイプが設定されていない場合はMagic3のレンダリング機能を使用する
$contentType = $gContentApi->getContentType();
- if (empty($contentType) && $wp_query->in_the_loop){ // WordPressのメインループ内にある場合のみメイン部の処理と判断する
+ if ($wp_query->in_the_loop && empty($contentType)){ // WordPressのメインループ内にある場合のみメイン部の処理と判断する
$componentPath = locate_template($templates);
// コンポーネント生成用スクリプトファイルを指定して、コンポーネントを生成
}
// 一覧の最後のデータの場合
- if ($wp_query->lastPostFound) echo $gPageManager->getWPContents('main-bottom');
+ if ($wp_query->in_the_loop && $wp_query->lastPostFound) echo $gPageManager->getWPContents('main-bottom');
}
/**