Yireo - Extensions, tutorials and blog for Magento and Joomla!

Blog Tags

MageBridge Standard

Joomla! modules in Magento content

Monday, 26 July 2010

One of the weirder (but cooler) tricks of MageBridge is that you can parse Joomla! content as if it was Magento content, and vice versa. Both Magento and Joomla! use mechanisms to filter content before it is being displayed on screen, and this opens up for a lot of opportunities. For instance, you can load a Joomla! module within your Magento product-description. Let's see how.

To use Joomla! Content Plugins ...

mb_content_plugin

mb_loadposition_loginWithin Joomla!s architecture, you can use plugins for things that are always a bit harder to explain to novices, bur which might come in handy. For instance, if your content contains an email-address, you can use the Email Cloaking plugin to protect this address against spam-robots and make it into a clickable link along the way.

The Email Cloaking plugin is a plugin in the group content and the main functionality of Content Plugins is to alter content. One other cool plugin is the Load Module plugin, which allows you to enter a tag in your content, which is later translated into the output of an actual Joomla! module. Take for instance the following tag:

{loadposition inner-content}

This tag could be inserted into a Joomla! article. If we then assign a new Joomla! module (for instance, a login module) to the position inner-content, it will automatically be displayed inside the content of the Joomla! article. This is a very powerful feature of Joomla!.

... on Magento content

mb_advanced_settingsBy default, these plugins can parse content of Joomla! articles but other types of content as well. We've taken this concept a bit further with MageBridge, by stating that any piece of information that comes out of Magento, could be treated as content as well.

One of the main features of MageBridge is that it fetches Magento blocks (part of the Magento theming layer) and displays them inside Joomla! (as component or as module). Now, within the MageBridge Configuration there is an option Enable Content Plugins that allows the Magento block-content to be parsed using Joomla! Content Plugins.

And the playing starts!

So with this setting, you can treat any Magento block as if it were Joomla! content. The first step here is that you can add Joomla! content-tags (like {loadposition}) within Magento category-descriptions or the short description of products.

But you can also include Joomla! modules within the Magento PHTML-templates (also part of the Magento theming layer). Let's say, there is a piece of the Magento checkout that needs more explanation. Normally, with Magento, you would modify the PHTML-templatecode, add some kind of translatable string, and translate that string using a CSV-based translation file.

Let's manage content that could not be managed before

But if you're building a site for a customer, than it is most likely too complicated for that customer to manage strings in a CSV-file. Instead, let's do it the Joomla! way: By inserting a {loadposition} tag in the PHTML-template, we create a new module position.

Now, in the Joomla! Administrator we can add a Custom HTML module and assign it to that position: And voila, the customer is able to manage content within the Magento checkout, using the Joomla! Module Manager.

mb_loadposition_phtml

Hope you got inspired to do cool stuff with MageBridge too.

Tags: magebridge

About Yireo

Yireo tries to help webdevelopers build successful Joomla! and Magento sites.

More about Yireo