Joomla Rule Engines & MetaTemplate


Published on

This presentation was given at the Joomla & Beyond conference in the Netherlands in May 2011.

Watch the video of the complete presentation here:

Note: MetaTemplate Pro has been renamed as "Chameleon" and you can find out more about it at

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Joomla Rule Engines & MetaTemplate

  1. 1. Joomla Rule Engines <ul><li>and the joy of Meta </li></ul><ul><li>Stephen Brandon </li></ul><ul><li>Brandon IT Consulting </li></ul><ul><li>[email_address] </li></ul>
  2. 2. Terms… <ul><li>MetaTemplate & MetaMod </li></ul><ul><li>Rule Engine </li></ul><ul><li>Rule Chain </li></ul>
  3. 4. In standard Joomla, how do I…
  4. 5. … modify output?
  5. 6. • plugins act on intermediate or final output
  6. 7. … make completely new types of pages?
  7. 8. • new component defines new types of pages
  8. 9. … alter look and feel of a page?
  9. 10. • new template applied to existing page gives it new look & feel • selection of modules on the page • overrides within a template affect HTML output of the component and modules
  10. 11. So what’s the problem?
  11. 12. <ul><li>different methods required to affect output in different parts of system e.g. plugins, overrides, SEO systems </li></ul><ul><li>synchronising and ordering different changes based on the same criteria e.g. for logged-in users, change template of this page and remove certain menu items </li></ul><ul><li>some tasks not available in Joomla e.g. ability to remove individual menu items </li></ul>
  12. 13. Actions to script
  13. 14. Actions to script (cont.)
  14. 15. Case Studies
  15. 16. <ul><li> </li></ul><ul><li>(unfortunately offline; screencast shown in live presentation) </li></ul>
  16. 17. <ul><li>use dedicated templates for specific devices (iPhone, iPad) </li></ul><ul><li>use dedicated template for Facebook embedding </li></ul><ul><li>ensure visitors exiting Facebook and viewing site normally return to normal template </li></ul>Business rules
  17. 18. <ul><li>pick up Facebook API key from POST request on first page load </li></ul><ul><li>“ remember” current context in cookie </li></ul><ul><li>detect URL parameters to trigger return to normal template </li></ul><ul><li>device detection </li></ul>Cool stuff
  18. 19. <ul><li>Google Analytics code: </li></ul><ul><li><script type=&quot;text/javascript&quot;> </li></ul><ul><li> var _gaq = _gaq || []; </li></ul><ul><li>_gaq.push(['_setAccount', 'UA-5246969-1']); // <== put your GA code here </li></ul><ul><li>_gaq.push(['_setCustomVar', </li></ul><ul><li>1, </li></ul><ul><li>'Template', </li></ul><ul><li>'ElectricStandard2011' // <== customise here for each template </li></ul><ul><li>]); </li></ul><ul><li><?php </li></ul><ul><li>$session =& JFactory::getSession(); </li></ul><ul><li>$info_string = $session->get( 'InfoString', '', 'metatemplate'); </li></ul><ul><li>if ($info_string != '') { </li></ul><ul><li>echo &quot;_gaq.push(['_setCustomVar',&quot;; </li></ul><ul><li>echo &quot;2,&quot;; </li></ul><ul><li>echo &quot;'InfoString',&quot;; </li></ul><ul><li>echo &quot;'$info_string'&quot;; </li></ul><ul><li>echo &quot;]);&quot;; </li></ul><ul><li>} </li></ul><ul><li>?> </li></ul><ul><li>_gaq.push(['_trackPageview']); </li></ul><ul><li>(function() { </li></ul><ul><li>var ga = document.createElement('script'); </li></ul><ul><li>ga.type = 'text/javascript'; ga.async = true; </li></ul><ul><li>ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + ''; </li></ul><ul><li>var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); </li></ul><ul><li>})(); </li></ul><ul><li></script> </li></ul>
  19. 20. Alexandre Therrien <>
  20. 21. <ul><li>Selling online, private, and correspondence guitar tuition </li></ul><ul><li>Providing a marketing platform for guitar teachers to connect to prospective students </li></ul>Business
  21. 22. Business Rules <ul><li>Determine what people are looking for, using any available clues e.g. Google search query, landing page for campaigns, GeoIP country of origin, language etc. </li></ul><ul><li>Use appropriate templates and modules to support that theme e.g. girls/women, metal, electric, Indonesia etc. </li></ul><ul><li>Track conversions in Analytics, noting the template used </li></ul>
  22. 23. Cool stuff <ul><li>detect search terms in Google referrer string e.g. “metal”; match to template </li></ul><ul><li>GeoIP and language detection; country/language specific templates & modules </li></ul><ul><li>template choices are “sticky” </li></ul><ul><li>RSForm includes info from MetaTemplate in contact e-mails </li></ul><ul><li>Google Analytics tracks template and conversion information </li></ul>
  23. 24. <ul><li>Demo </li></ul>
  24. 32. Opportunity <ul><li>Seeking a marketing partner in NL/Europe with interest in music; strong marketing skills </li></ul><ul><li>Contact Alexandre Therrien <> </li></ul>
  25. 33. <ul><li> </li></ul>
  26. 34. <ul><li>GEL sells and implements Local Listing Management for small businesses e.g. Google Places, Yelp, Yellowpages, etc </li></ul><ul><li>Affiliate program is used to match clients to a local affiliate </li></ul><ul><li>Site is branded according to local affiliate </li></ul>Business
  27. 35. Business Rules <ul><li>Affiliate programme brands the site to a local affiliate, once site identifies location of visitor via GeoIP, zip code (form) or URL </li></ul><ul><li>Branding includes banners, logos, contact numbers, pricing, live chat, menu items etc. </li></ul><ul><li>Once determined, Affiliate–customer link is permanent </li></ul>
  28. 36. <ul><li>some basic form processing handled in MetaTemplate; can be done on any URL </li></ul><ul><li>affiliate links create permanent linkage, while zip code changes can change affiliate </li></ul><ul><li>GeoIP for zip codes; removing/hiding menu items for some users </li></ul><ul><li>Getting info from AEC </li></ul>Cool stuff
  29. 37. <ul><li>Demo and use zip codes: 95008, 94203, or 93401 </li></ul><ul><li> (clear cookies...) </li></ul>