質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.49%
XML

XMLは仕様の1つで、マークアップ言語群を構築するために使われています。

Q&A

1回答

777閲覧

以下のxmlを書き換えてボタンの表示場所を変えるにはどうすればよいでしょうか?

h-o

総合スコア134

XML

XMLは仕様の1つで、マークアップ言語群を構築するために使われています。

0グッド

0クリップ

投稿2017/10/26 07:27

###やりたいこと
以下の画像のような あるページ(Aページ)でxmlを書き換えてSNSボタンの表示位置を変更したいです。
どう書き換えればよいでしょうか?**

イメージ説明

###以下、関係箇所のコード

【SNSボタンのレイアウトを定義する部分のコード】

<catalog_product_view> <reference name="alert.urls"> <block type="rewardpointsbehavior/showrewardpoint" name="rewardpointsbehavior.product.view" before="-" template="rewardpointsbehavior/productpointinfo.phtml" /> </reference> <reference name="content"> <block type="rewardpointsbehavior/showrewardpoint" before="-" name="behavior.social.share" template="rewardpointsbehavior/share.phtml" > <block type="rewardpointsbehavior/showrewardpoint" name="facebook.like" template="rewardpointsbehavior/share/facebook-like.phtml" /> <block type="rewardpointsbehavior/showrewardpoint" name="facebook.share" template="rewardpointsbehavior/share/facebook-share.phtml" /> <block type="rewardpointsbehavior/showrewardpoint" name="twitter.tweet" as="twitter.tweet" template="rewardpointsbehavior/share/twitter.phtml" /> <block type="rewardpointsbehavior/showrewardpoint" name="google.plus" as="google.plus" template="rewardpointsbehavior/share/google-plus.phtml" /> <block type="rewardpointsbehavior/showrewardpoint" name="pinterest.pin" template="rewardpointsbehavior/share/pinterest.phtml" /><!--xuanbinh--> </block> </reference> </catalog_product_view>

【Aページのレイアウトを定義するxml内のSNSボタンを表示させたい部分のコード】(以下、B)

<block type="catalog/product_view" name="product.info.sharing" as="sharing" template="catalog/product/view/sharing.phtml"/>

【ページA全体のレイアウトを定義するxml】(Bが含まれる)

<?xml version="1.0"?> <layout version="0.1.0"> <!--------------------------------------- 省略 ----------------------------------------> <!-- Product view --> <catalog_product_view translate="label"> <label>Catalog Product View (Any)</label> <!-- Mage_Catalog --> <reference name="root"> <action method="setTemplate"><template>page/1column.phtml</template></action> </reference> <reference name="content"> <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml"> <!-- <action method="addReviewSummaryTemplate"><type>default</type><template>review/helper/summary.phtml</template></action> <action method="addReviewSummaryTemplate"><type>short</type><template>review/helper/summary_short.phtml</template></action> <action method="addReviewSummaryTemplate"><type>...</type><template>...</template></action> --> <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"> <block type="core/text_list" name="product.info.media.after" as="after" /> </block> <block type="core/text_list" name="alert.urls" as="alert_urls" translate="label"> <label>Alert Urls</label> </block> <action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action> <block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml"> <action method="setColumnCount"><columns>6</columns></action> <action method="setItemLimit"><type>upsell</type><limit>6</limit></action> </block> <block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" /> <block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml"> <action method="addToParentGroup"><group>detailed_info</group></action> <action method="setTitle" translate="value"><value>Description</value></action> </block> <block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml"> <action method="addToParentGroup"><group>detailed_info</group></action> <action method="setTitle" translate="value"><value>Additional Information</value></action> </block> <block type="catalog/product_list_related" name="catalog.product.related" as="related_products" template="catalog/product/list/related.phtml" /> <block type="catalog/product_view" name="product.info.addto" as="addto" template="catalog/product/view/addto.phtml"/> <!--ここにボタン定義を書きたい--> <block type="catalog/product_view" name="product.info.sharing" as="sharing" template="catalog/product/view/sharing.phtml"/> <!-- / ここにボタン定義を書きたい--> <block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/> <block type="core/text_list" name="product.info.extrahint" as="extrahint" translate="label"> <label>Product View Extra Hint</label> </block> <block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml" translate="label"> <label>Info Column Options Wrapper</label> <block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/> <block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml"> <action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action> <action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action> <action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action> <action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action> </block> <block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/> </block> <block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="catalog/product/view/options/wrapper/bottom.phtml" translate="label"> <label>Bottom Block Options Wrapper</label> <action method="insert"><block>product.tierprices</block></action> <block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/> <action method="append"><block>product.info.addtocart</block></action> <action method="append"><block>product.info.addto</block></action> <action method="append"><block>product.info.sharing</block></action> </block> <block type="core/template_facade" name="product.info.container1" as="container1"> <action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action> <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action> <action method="append"><block>product.info.options.wrapper</block></action> <action method="append"><block>product.info.options.wrapper.bottom</block></action> </block> <block type="core/template_facade" name="product.info.container2" as="container2"> <action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action> <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action> <action method="append"><block>product.info.options.wrapper</block></action> <action method="append"><block>product.info.options.wrapper.bottom</block></action> </block> <action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action> <action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action> </block> </reference> <reference name="right"> </reference> </catalog_product_view> <!--------------------------------------- 省略 ----------------------------------------> </layout>

不明点があれば追記いたします。
よろしくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

裏でxml->htmlの変換を担うプログラムが動いている筈。
そしてレイアウトは恐らくtemplate="ほにゃらら.phtml"で指定されている型紙ファイルの中に規定されていると想像できます。
この二者の仕様を確認して下さい。
それがが分からない限り、 具体的な書きかえ方法を示すことは無理です。

投稿2017/10/26 07:46

KojiDoi

総合スコア13671

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

h-o

2017/10/26 07:58

回答をいただき誠にありがとうございます。 恐れ入リますが、何を追記すればよろしいでしょうか?
KojiDoi

2017/10/26 08:26

いや、だから、変換ルールが何処にも示されていないのに具体的な方法判るわけ無いじゃないですか。そこを丸投げされてもエスパー以外答えられませんよ。 せめてどこのシステムを使ってページを作ろうとしているのかぐらい書いてください。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.49%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問