Adding custom code in head (header html tag)
문제
we want to add the google+ links / code to our head (html) tag in our website. We have a multisite. We could edit phtml, create phtm etc ...
What is the best way to do this? via xml update?
Or is there another way?
Many thanks!
해결책
To answer your question:
add this to local.xml
:
<default>
<reference name="head">
<block type="cms/block" name="google_plus" as="google_plus">
<action method="setBlockId"><block_id>google_plus</block_id></action>
</block>
</reference>
</default>
Now create a cms block with the identifier google_plus
and put your content in it.
To solve your problem (easier):
Use the field Miscellaneous Scripts
from System->Configuration->Design->Head
and put your scripts in there. They will be added before the </head>
tag and you can set different scripts per website or even store views.
제휴하지 않습니다 magento.stackexchange