Joomla Tip – Custom Content Integration with Jumi

Just wanted to share a Joomla (1.7) tip on how we were able to integrate custom content from an external web application with custom PHP code via the Jumi component and plugin (http://bit.ly/wWIQmz).

Joomla by default does not allow custom PHP code to be added to articles (content pages) functionality which is provided by the Jumi component. However in our case we also wanted to display the most recent report on the home page, plus the last 10 from the archives when the user asks to view more.

  1. Create custom PHP files to load the current report and one for the archives. These were placed in the Jumi component files folder. TIP Always include the PHP line  defined('_JEXEC') OR defined('_VALID_MOS') OR die( "Direct Access Is Not Allowed" ); at the top of the file to ensure that it cannot be loaded directly via HTTP.
  2. Create Joolma article with a Jumi plugin to load content from the external url. We used two calls to the url, the first one to load the latest report and executive summary and the second to load the archives.
  3. Use the excellent Gavick News Show Pro GK4 (http://tools.gavick.com/newshowpro.html) to load the article into a module position. However since we can limit the text brought back, we limited the text only to the first plugin call to load the latest report only. This will include a more link to display the current report and archives.

NOTES:

  1. When loading external urls we used the Curl Library (inbuilt in most PHP installations) since file_get_contents() is usually blocked from accessing external urls
  2. We could not use an external library as it seem like Jumi does not handle include paths very well, so we could not maintain configurations in an external file.
  3. When deploying into production, we had to set caching on otherwise the page loading took too long

Hope this helps you

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: