MT5におけるウェブサイトと、配下のブログの関係をボチボチお勉強
Website-A ├Blog-A1 └Blog-A2
こんな構成になっているとしたとき、
<mt:BlogParentWebsite> <$mt:WebsiteID setvar="website_id"$> </mt:BlogParentWebsite> <$mt:Include module="※モジュール名※" blog_id="$website_id"$> [確認用]website_id: <$mt:GetVar name="website_id"$>
BlogA-1のテンプレ
1. 子ブログ内でいきなりmt:WebsiteID:<$mt:WebsiteID$><br />
<mt:BlogParentWebsite><$mt:WebsiteID setvar="website_id">
2. 子ブログ内mtBlogParentWebsiteブロックタグの中でMTWebsiteID: <$mt:WebsiteID$><br />
3. 子ブログ内mtBlogParentWebsiteブロックタグの中で親サイトのテンプレートモジュール呼び出し
(その中でmt:WebsiteID):<$mt:Include module="WS-module" blog_id="$website_id"$><br />
</mt:BlogParentWebsite>
4. 子ブログ内mtBlogParentWebsiteブロックタグの外で親サイトのテンプレートモジュール呼び出し(その中でmt:WebsiteID):
<$mt:Include module="WS-module" blog_id="$website_id"$><br />
Website-A内のテンプレートモジュール(WS-module)
<$mt:WebsiteID$>
結果
1.子ブログ内でいきなりmt:WebsiteID:0 -> NG 2. 子ブログ内mtBlogParentWebsiteブロックタグの中でMTWebsiteID: 1 -> OK 3. 子ブログ内mtBlogParentWebsiteブロックタグの中で親サイトのテンプレートモジュール呼び出し (その中でmt:WebsiteID):1 -> OK 4. 子ブログ内mtBlogParentWebsiteブロックタグの外で親サイトのテンプレートモジュール呼び出し (その中でmt:WebsiteID):0 -> NG