Yireo tutorials

Learn more about Joomla!TM and Magento
You are here: Home Tutorials MageBridge MageBridge theming Applying XML Layout Updates in MageBridge - (1) Overview

Applying XML Layout Updates in MageBridge - (1) Overview

Within MagentoTM theming, XML layout updates are very powerful when it comes to altering the standard behaviour of pages or adding new dynamic blocks to your content. This tutorial explains how you can use MageBridgeTM to apply this Magento functionality to Joomla!TM as well.

Introducing the MageBridge swiss-army knife

MageBridge integrates Magento in Joomla!, that's the easy part. Both Joomla! as Magento ship with a lot of tricks to alter their content through third party plugins, and MageBridge just takes these concepts to a higher level: Joomla! tricks can be applied to Magento content, and Magento tricks can be applied to Joomla! content.

Within Joomla!, there is the concept of Content Plugins which allow Joomla! content to be filtered and modified. For instance, the Email Cloaking plugin translates email-addresses into little pieces of JavaScript (protecting them against spamrobots). Now, MageBridge includes a setting to apply these Content Plugins to Magento content as well. If your product description contains an email-address, it will be translated by the Email Cloaking plugin as well.

mb_xml_layout_updates1

Within the MageBridge Configuration, you can find this setting Enable Content Plugins under the tab Other Settings. Note that this has nothing to do with MageBridge plugins.

Magento CMS Markup Tags and XML Layout Updates

Within Magento, there are the concepts of CMS Markup Tags and XML Layout Updates. These could be applied to Magento content, for instance to the Magento homepage. An example CMS Markup tag looks like this:

{{block type="tag/popular" template="tag/popular.phtml"}}

This might add a Popular Tags block to the Magento homepage. The same could be applied through a XML Layout Update:

<block type="tag/popular" template="tag/popular.phtml" />

Why use XML Layout Updates instead of CMS Markup Tags?

The main difference between this XML-code and these CMS-tags is that with XML, more things can be defined. For instance, you can change the existing content of a page. A simple example is the following XML-tag that adds a list of random products to the block named "content".

<reference name="content">
<block type="catalog/product_list_random" name="random" template="catalog/product/list.phtml" before="-" />
</reference>

Note, that all this talk about Magento XML-code is still native to Magento theming. If you are lost, this means that you need to polish up your knowledge of Magento theming. MageBridge just takes these concepts to another level.

The challenge with Joomla! content

When adding XML Layout Updates within Magento, you are actually updating Magento's page layout with this XML-code. But the MageBridge module in Magento is initialized at a point that the page layout is already decided. MageBridge is able to re-use all Magento theming parts, but is not able to redo it.

Conclusion: XML Layout Updates need to be applied to Magento content. The result of this can be bridged again using MageBridge. But XML Layout Updates can not be applied to directly to Joomla! content.

Two scenarios

To apply XML Layout Updates to Magento content and re-use this within Joomla!, you'll need to put various pieces together. When looking at the many options that MageBridge offers, we can distinct two different scenarios:

  • Applying XML-code to a CMS Page
    Create a Magento CMS Page and apply the XML Layout Update to this page. Next, go to Joomla! and create a new Menu-Item of the type MageBridge Custom Page. Enter the Magento URL Key as MageBridge Request Path.
    Continue to part 2 of this tutorial
  • Using CMS-markup tags in Joomla! content
    Instead of using the XML-code, we can also use the CMS-markup tags directly in Joomla! articles. For this, we need the MageBridge Content Plugin to be enabled.
    Read more about the MageBridge Content Plugin here
 

Payments Methods

Payment Methods