Bild auf Homepage in Spalte einfügen

      Hallo Klaus,

      ich würde das durch Hinzufügen einer neuen Box erledigen. Diese wird dann in der entsprechenden xml-Datei des Interfaces aufgerufen und das wars :D

      OK, das war jetzt nicht gerade so beschrieben, dass man versteht, was ich meine, wenn man Magento nicht selbst programmiert hat (ich habe das zunächst auch nicht begriffen, geht wohl jedem so).

      Also Du definierst eine Box im Admin unter CMS > Statische Blöcke. Wichtig ist der Name, den brauchst Du noch. Ich nenne ihn mal "beispielblock".

      Dann musst Du die entsprechende xml-Datei aus Deinem Template in einen Editor laden. Das ist normalerweise die Datei "catalog.xml" im Verzeichnsi app/design/frontend/default/DEINTEMPLATE/layout

      Spätestens jetzt solltest Du übrigens ein eigenes Template definieren, sonst ist diese Änderung nämlich beim nächsten Update wieder verschwunden, weil vom System überschrieben. Wie man eigene Template erstellt, wird hier an anderer Stelle beschrieben. Die Supersuperkurzform hierzu zum besseren Verständnis: Da wo der zweite verschachtelte Ordner "default" steht, einfach einen neuen Ordner erstellen und beliebig benennen (beispielsweise red oder black). grundsätzlich werden in einem eigenen Template nur Dateien hinterlegt, die gegenüber "default" verändert sind, den Rest zieht sich Magento IMMER vom Template default.

      Jetzt schließt sich der Kreis: Wenn Du also eine Datei aus dem Template default dauerhaft verändern willst, dann verändere sie nach Wunsch und lege sie in einem anderen Ordner ab (mit der identischen Verzeichnisstruktur wie bei default) und schon hast Du ein eigenes Template erschaffen. Natürlich muss das neue Template (der Ordnername) dann im Admin aufgerufen werden, Magento kann ja nicht wissen, ob jetzt default, modern oder Dein neues Template. Auf jeden Fall kann Deine Änderung jetzt bei Systemnupdates nicht mehr überschrieben werden.

      OK, wieder zurück zur catalog.xml :)

      Hier musst Du jetzt folgenden Code hinzufügen:

      <reference name="left"> (es geht natürlich auch right, halt da, wo der Block stehen soll)
      <block type="cms/block" name="beispielblock" before="-">
      <action method="setBlockId"><block_id>beispielblock</block_id></action>
      </block>
      </reference>

      Für die Bezeichnung "beispielblock" den Namen des statischen Blocks nutzen, den Du zuvor im Admin angelegt hast.


      Habs jetzt selbst nicht probiert, sollte aber so gehen.



      Gruß
      Ingo
      Hallo Ingo,

      danke für die schnelle Antwort. Hat soweit auch alles super geklappt. Allerdings die Stelle zum einfügen in die catalog.xml Datei ist bei mir noch falsch.

      Habe als letzte Box unten "Popular Tags". Darunter hätte ich gerne die neue Box. Wo muss ich diese einfügen? in der catalog.xml (wenn ja wo? ) oder in einer anderen xml Datei ?


      Gruß
      Klaus
      Hallo Klaus,

      der Code muss in die catalog.xml eingetragen werden, und zwar hinter den letzten Boxaufruf für die left/right bar (kann man im Code ganz gut sehen, der Code sieht ähnlich aus).

      Poste doch einfach mal den Code aus Deiner catalog.xml ...


      Gruß
      Ingo
      Hallo meine catalog.xml

      XML-Quellcode

      1. <?xml version="1.0"?>
      2. <!--
      3. /**
      4. Supported layout update handles (action):
      5. - catalog_product_gallery
      6. - catalog_product_compare_index
      7. Supported layout update handles (special):
      8. - default
      9. - catalog_category_default
      10. - catalog_category_layered
      11. - catalog_product_view
      12. -->
      13. <layout version="0.1.0">
      14. <!--
      15. Default layout, loads most of the pages
      16. -->
      17. <default>
      18. <!-- Mage_Catalog -->
      19. <reference name="top.menu">
      20. <block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml"/>
      21. </reference>
      22. <reference name="left">
      23. <!--<block type="core/template" name="left.permanent.callout" after="-" template="callouts/left_col.phtml">
      24. <action method="setImgSrc"><src>images/media/col_left_callout.jpg</src></action>
      25. <action method="setImgAlt" translate="alt" module="catalog"><alt>Did you know? Our customer service is available 24/7</alt></action>
      26. </block>-->
      27. </reference>
      28. <reference name="right">
      29. <!--<block type="core/template" name="right.permanent.callout" after="-" template="callouts/left_col.phtml">
      30. <action method="setImgSrc"><src>images/media/col_right_callout.jpg</src></action>
      31. <action method="setImgAlt" translate="alt" module="catalog"><alt>back to school</alt></action>
      32. </block>-->
      33. </reference>
      34. <reference name="footer_links">
      35. <action method="addLink" translate="label title" module="catalog" ifconfig="catalog/seo/site_map"><label>Site Map</label><url helper="catalog/map/getCategoryUrl" /><title>Site Map</title></action>
      36. </reference>
      37. </default>
      38. <!--
      39. Category default layout
      40. -->
      41. <catalog_category_default>
      42. <reference name="root">
      43. <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
      44. </reference>
      45. <reference name="left">
      46. <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
      47. </reference>
      48. <reference name="content">
      49. <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
      50. <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
      51. <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
      52. <!-- The following code shows how to set your own pager increments -->
      53. <!--
      54. <action method="setDefaultListPerPage"><limit>10</limit></action>
      55. <action method="setDefaultGridPerPage"><limit>8</limit></action>
      56. <action method="addPagerLimit"><mode>list</mode><limit>10</limit></action>
      57. <action method="addPagerLimit"><mode>list</mode><limit>20</limit></action>
      58. <action method="addPagerLimit"><mode>list</mode><limit>30</limit></action>
      59. <action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
      60. <action method="addPagerLimit"><mode>grid</mode><limit>8</limit></action>
      61. <action method="addPagerLimit"><mode>grid</mode><limit>16</limit></action>
      62. <action method="addPagerLimit"><mode>grid</mode><limit>24</limit></action>
      63. <action method="addPagerLimit" translate="label"><mode>grid</mode><limit>all</limit><label>All</label></action>
      64. -->
      65. </block>
      66. <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
      67. </block>
      68. </block>
      69. </reference>
      70. </catalog_category_default>
      71. <!--
      72. Category layered navigation layout
      73. -->
      74. <catalog_category_layered>
      75. <reference name="root">
      76. <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
      77. </reference>
      78. <reference name="left">
      79. <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
      80. </reference>
      81. <reference name="content">
      82. <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
      83. <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
      84. <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
      85. <!-- The following code shows how to set your own pager increments -->
      86. <!--
      87. <action method="setDefaultListPerPage"><limit>10</limit></action>
      88. <action method="setDefaultGridPerPage"><limit>8</limit></action>
      89. <action method="addPagerLimit"><mode>list</mode><limit>10</limit></action>
      90. <action method="addPagerLimit"><mode>list</mode><limit>20</limit></action>
      91. <action method="addPagerLimit"><mode>list</mode><limit>30</limit></action>
      92. <action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
      93. <action method="addPagerLimit"><mode>grid</mode><limit>8</limit></action>
      94. <action method="addPagerLimit"><mode>grid</mode><limit>16</limit></action>
      95. <action method="addPagerLimit"><mode>grid</mode><limit>24</limit></action>
      96. <action method="addPagerLimit" translate="label"><mode>grid</mode><limit>all</limit><label>All</label></action>
      97. -->
      98. </block>
      99. <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
      100. </block>
      101. </block>
      102. </reference>
      103. </catalog_category_layered>
      104. <catalog_category_layered_nochildren>
      105. <remove name="right.reports.product.viewed" />
      106. <reference name="left">
      107. <!--<block type="reports/product_viewed" before="right.permanent.callout" name="left.reports.product.viewed" template="reports/product_viewed.phtml" />-->
      108. </reference>
      109. </catalog_category_layered_nochildren>
      110. <!--
      111. Compare products page
      112. -->
      113. <catalog_product_compare_index>
      114. <!-- Mage_Catalog -->
      115. <reference name="root">
      116. <action method="setTemplate"><template>page/one-column.phtml</template></action>
      117. </reference>
      118. <reference name="head">
      119. <action method="addJs"><script>scriptaculous/scriptaculous.js</script></action>
      120. <action method="addJs"><script>varien/product.js</script></action>
      121. </reference>
      122. <reference name="content">
      123. <block type="catalog/product_compare_list" name="catalog.compare.list" template="catalog/product/compare/list.phtml"/>
      124. </reference>
      125. </catalog_product_compare_index>
      126. <customer_account_index>
      127. <reference name="left">
      128. <action method="unsetChild"><name>catalog_compare_sidebar</name></action>
      129. </reference>
      130. </customer_account_index>
      131. <!--
      132. Product view
      133. -->
      134. <catalog_product_view>
      135. <!-- Mage_Catalog -->
      136. <reference name="root">
      137. </reference>
      138. <reference name="head">
      139. <action method="addJs"><script>varien/product.js</script></action>
      140. </reference>
      141. <reference name="content">
      142. <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
      143. <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>
      144. <block type="core/text_list" name="alert.urls" as="alert_urls" />
      145. <block type="catalog/product_view" name="product.tierprices" as="tierprices" template="catalog/product/view/tierprices.phtml"/>
      146. <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
      147. <action method="addTab" translate="title" module="catalog"><alias>description</alias><title>Product Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action>
      148. <action method="addTab" translate="title" module="catalog"><alias>upsell_products</alias><title>We Also Recommend</title><block>catalog/product_list_upsell</block><template>catalog/product/list/upsell.phtml</template></action>
      149. <action method="addTab" translate="title" module="catalog"><alias>additional</alias><title>Additional Information</title><block>catalog/product_view_attributes</block><template>catalog/product/view/attributes.phtml</template></action>
      150. </block>
      151. <block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
      152. <block type="catalog/product_view" name="product.info.addto" as="addto" template="catalog/product/view/addto.phtml" />
      153. <block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml" />
      154. <block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml">
      155. <block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
      156. <action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
      157. <action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
      158. <action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
      159. <action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
      160. </block>
      161. </block>
      162. <block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="catalog/product/view/options/wrapper/bottom.phtml">
      163. <action method="insert"><block>product.tierprices</block></action>
      164. <block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>
      165. <action method="append"><block>product.info.addtocart</block></action>
      166. </block>
      167. <block type="core/template_facade" name="product.info.container1" as="container1">
      168. <action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
      169. <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
      170. <action method="append"><block>product.info.options.wrapper</block></action>
      171. <action method="append"><block>product.info.options.wrapper.bottom</block></action>
      172. </block>
      173. <block type="core/template_facade" name="product.info.container2" as="container2">
      174. <action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
      175. <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
      176. <action method="append"><block>product.info.options.wrapper</block></action>
      177. <action method="append"><block>product.info.options.wrapper.bottom</block></action>
      178. </block>
      179. <action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
      180. <action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
      181. </block>
      182. </reference>
      183. <reference name="upsell_products">
      184. <action method="setColumnCount"><columns>5</columns></action>
      185. <action method="setItemLimit"><type>upsell</type><limit>5</limit></action>
      186. </reference>
      187. <reference name="left">
      188. <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>
      189. </reference>
      190. </catalog_product_view>
      191. <!--
      192. Additional block dependant on product type
      193. -->
      194. <PRODUCT_TYPE_simple>
      195. <reference name="product.info">
      196. <block type="catalog/product_view_type_simple" name="product.info.simple" as="product_type_data" template="catalog/product/view/type/simple.phtml"/>
      197. </reference>
      198. </PRODUCT_TYPE_simple>
      199. <PRODUCT_TYPE_configurable>
      200. <reference name="product.info">
      201. <block type="catalog/product_view_type_configurable" name="product.info.configurable" as="product_type_data" template="catalog/product/view/type/configurable.phtml"/>
      202. </reference>
      203. <reference name="product.info.options.wrapper">
      204. <block type="catalog/product_view_type_configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="catalog/product/view/type/options/configurable.phtml"/>
      205. </reference>
      206. </PRODUCT_TYPE_configurable>
      207. <PRODUCT_TYPE_grouped>
      208. <reference name="product.info">
      209. <block type="catalog/product_view_type_grouped" name="product.info.grouped" as="product_type_data" template="catalog/product/view/type/grouped.phtml"/>
      210. </reference>
      211. </PRODUCT_TYPE_grouped>
      212. <PRODUCT_TYPE_virtual>
      213. <reference name="product.info">
      214. <block type="catalog/product_view_type_virtual" name="product.info.virtual" as="product_type_data" template="catalog/product/view/type/virtual.phtml"/>
      215. </reference>
      216. </PRODUCT_TYPE_virtual>
      217. <!--
      218. Product send to friend
      219. -->
      220. <catalog_product_send>
      221. <!-- Mage_Catalog -->
      222. <reference name="root">
      223. </reference>
      224. <reference name="head">
      225. <action method="addJs"><script>varien/product.js</script></action>
      226. </reference>
      227. <reference name="content">
      228. <block type="catalog/product_send" name="product.send" template="catalog/product/send.phtml">
      229. </block>
      230. </reference>
      231. </catalog_product_send>
      232. <!--
      233. Product additional images gallery popup
      234. -->
      235. <catalog_product_gallery>
      236. <!-- Mage_Catalog -->
      237. <reference name="root">
      238. <action method="setTemplate"><template>page/empty.phtml</template></action>
      239. </reference>
      240. <reference name="content">
      241. <block type="catalog/product_gallery" name="catalog_product_gallery" template="catalog/product/gallery.phtml"/>
      242. </reference>
      243. </catalog_product_gallery>
      244. <!--
      245. SEO Site Map
      246. -->
      247. <catalog_seo_sitemap>
      248. <remove name="left"/>
      249. <reference name="root">
      250. <action method="setTemplate"><template>page/1column.phtml</template></action>
      251. </reference>
      252. <reference name="content">
      253. <block type="page/template_container" name="seo.sitemap.container" template="catalog/seo/sitemap/container.phtml">
      254. <block type="page/template_links" name="seo.sitemap.links" as="links" template="page/template/links.phtml"/>
      255. <block type="page/html_pager" name="seo.sitemap.pager.top" as="pager_top" template="page/html/pager.phtml"/>
      256. <block type="page/html_pager" name="seo.sitemap.pager.bottom" as="pager_bottom" template="page/html/pager.phtml"/>
      257. </block>
      258. </reference>
      259. </catalog_seo_sitemap>
      260. <catalog_seo_sitemap_category>
      261. <update handle="catalog_seo_sitemap" />
      262. <reference name="seo.sitemap.container">
      263. <action method="setTitle" translate="title" module="catalog"><title>Categories</title></action>
      264. <block type="catalog/seo_sitemap_category" name="seo.sitemap.sitemap" as="sitemap" after="pager_top" template="catalog/seo/sitemap.phtml">
      265. <action method="bindPager"><pager>seo.sitemap.pager.top</pager></action>
      266. <action method="bindPager"><pager>seo.sitemap.pager.bottom</pager></action>
      267. <action method="setItemsTitle" translate="title" module="catalog"><title>categories</title></action>
      268. </block>
      269. </reference>
      270. <reference name="seo.sitemap.links">
      271. <action method="addLink" translate="label title" module="catalog"><label>Products Sitemap</label><url helper="catalog/map/getProductUrl"/><title>Products Sitemap</title></action>
      272. </reference>
      273. </catalog_seo_sitemap_category>
      274. <catalog_seo_sitemap_product>
      275. <update handle="catalog_seo_sitemap" />
      276. <reference name="seo.sitemap.container">
      277. <action method="setTitle" translate="title" module="catalog"><title>Products</title></action>
      278. <block type="catalog/seo_sitemap_product" name="seo.sitemap.sitemap" as="sitemap" after="pager_top" template="catalog/seo/sitemap.phtml">
      279. <action method="bindPager"><pager>seo.sitemap.pager.top</pager></action>
      280. <action method="bindPager"><pager>seo.sitemap.pager.bottom</pager></action>
      281. <action method="setItemsTitle" translate="title" module="catalog"><title>products</title></action>
      282. </block>
      283. </reference>
      284. <reference name="seo.sitemap.links">
      285. <action method="addLink" translate="label title" module="catalog"><label>Categories Sitemap</label><url helper="catalog/map/getCategoryUrl"/><title>Categories Sitemap</title></action>
      286. </reference>
      287. </catalog_seo_sitemap_product>
      288. <!--
      289. Catalog search terms block
      290. -->
      291. <catalog_seo_searchterm_popular>
      292. <remove name="left"/>
      293. <reference name="root">
      294. <action method="setTemplate"><template>page/1column.phtml</template></action>
      295. </reference>
      296. <reference name="content">
      297. <block type="catalog/seo_searchterm" name="seo.searchterm" template="catalog/seo/searchterm.phtml"/>
      298. </reference>
      299. </catalog_seo_searchterm_popular>
      300. </layout>
      Gruß
      Klaus