Your SlideShare is downloading. ×
0
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Flash Templates- Joomla!Days NL 2009 #jd09nl
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Flash Templates- Joomla!Days NL 2009 #jd09nl

2,780

Published on

Presentation on Joomla!Days Netherlands by Herman Peeren

Presentation on Joomla!Days Netherlands by Herman Peeren

Published in: Technology, Art & Photos
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,780
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
65
Comments
0
Likes
5
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Flash templates for Joomla! Using XML for data-exchange Herman Peeren Dutch Joomla!Days, June 13, 2009
  • 2. Herman Peeren <ul><li>Creating is manipulating </li></ul><ul><li>Standards, interfaces and Open Source </li></ul><ul><li>why I like Joomla! </li></ul><ul><li>and Flash… </li></ul><ul><li>[email_address] </li></ul>
  • 3. <ul><li>Flash (dis)advantages - and solutions </li></ul><ul><li>data-exchange with J-AMFPHP </li></ul><ul><li>using XML for data-exchange </li></ul><ul><li>reading XML into Flash </li></ul><ul><li>using feeds from Joomla! to produce XML </li></ul><ul><li>using webservices for two-way exchange </li></ul><ul><li>TODO, under construction </li></ul>Flash templates for Joomla! Agenda:
  • 4. Flash (dis)advantages <ul><li>great scaling to screen </li></ul><ul><li>browser independant </li></ul><ul><li>alpha-transparancy; no matte -drama </li></ul><ul><li>font embedding </li></ul><ul><li>movement &amp; sound </li></ul><ul><li>Actionscript: familiar and mature language </li></ul><ul><li>SEO more difficult </li></ul><ul><li>less CSS-support </li></ul><ul><li>no back-button </li></ul><ul><li>no easy event tracking </li></ul><ul><li>you need extra provisions in case Flash Player is missing </li></ul>+ -
  • 5. IE-6 CSS-bugs: who cares? <ul><li>Some of my customer’s websites still have &gt; 15% IE6 -visitors! (yes, in 2009) </li></ul><ul><li>professional websites/webapplications cannot ignore IE6, UNFORTUNATELY. </li></ul><ul><li>peekaboo-bug, multiple classes bug, ID-class bug, box model bug, double margin float bug, haslayout-problems, no png-(alpha)transparancy, no min/max-width/height, etc. </li></ul>
  • 6. <ul><li>Part of overriding mod_mainmenu: </li></ul><ul><li>//geef class=&amp;quot;itemNrX&amp;quot; mee aan li- en anker-tag (met X = hoeveelste item) bij level==1 (hoogste niveau) </li></ul><ul><li>$x=1; </li></ul><ul><li>if (($node-&gt;name() == &apos;ul&apos;) &amp;&amp; ($node-&gt;attributes(&apos;class&apos;)!=&apos;menualgemeen&apos;)) { </li></ul><ul><li>foreach ($node-&gt;children() as $child) </li></ul><ul><li>{ </li></ul><ul><li>if (($child-&gt;name() == &apos;li&apos;) &amp;&amp;($child-&gt;attributes(&apos;level&apos;)==1)) { </li></ul><ul><li>//hang die class aan de li </li></ul><ul><li>if ($child-&gt;attributes(&apos;class&apos;)) { </li></ul><ul><li>$child-&gt;addAttribute(&apos;class&apos;, $child-&gt;attributes(&apos;class&apos;).&apos; itemNr&apos;.$x); </li></ul><ul><li>} else { </li></ul><ul><li>$child-&gt;addAttribute(&apos;class&apos;, &apos;itemNr&apos;.$x); </li></ul><ul><li>} </li></ul><ul><li>//en aan de bijbehorende anchor-tag TO AVOID MULTIPLE CLASSES BUG </li></ul><ul><li>foreach ($child-&gt;children() as $grchild) </li></ul><ul><li>{ </li></ul><ul><li>if ($grchild-&gt;name() == &apos;a&apos;) { </li></ul><ul><li>$grchild-&gt;addAttribute(&apos;class&apos;, &apos;itemNr&apos;.$x); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>$x++; </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>Excursion: template override to avoid multiple classes bug
  • 7. More HTML in Flash textfield <ul><li>FPXHTMLRENDER 1.2.2: sourceforge.net/projects/fpxhtmlrender </li></ul><ul><li>beware of the mafia... </li></ul><ul><li>To use with Joomla! back-end, see: stevenstark.com/images/flash+cms.pdf </li></ul>
  • 8. Google in the Middle Ages Isidorus of Seville (560 - 636)
  • 9. Better SEO: HTML-layer <ul><li>make a HTML-layer under a Flash-layer </li></ul><ul><li>easy to do with a CMS </li></ul><ul><li>you can even put some EXTRA text there </li></ul><ul><li>BTW: trick of using content double in a template can sometimes be handy </li></ul>
  • 10. More SEO for Flash <ul><li>Flash Actionscript cooperates very well with JavaScript </li></ul><ul><li>You can track events and trigger JavaScript to make bookmarkable URLs, get conversion code etc. </li></ul><ul><li>nice article about this subject (in Dutch): </li></ul><ul><li>http://naarvoren.nl/artikel/flash_en_javascript </li></ul>
  • 11. data-exchange with J-AMFPHP <ul><li>AMF: Action Message Format = a binary format for data exchange with Flash </li></ul><ul><li>can communicate with webservices </li></ul><ul><li>AMF and PHP: amfphp.org; used in J-AMFPHP </li></ul><ul><li>at this moment THE way to exchange data between Joomla! and Flash </li></ul><ul><li>figo.tandolin.co.za/adobe-air/how-to-use-jamfphp-for-joomla-remoting.htm </li></ul>
  • 12. Using XML for data exchange <ul><li>broader standard, which can also be used to exchange data with other programs </li></ul><ul><li>looking for a more universal interface </li></ul>
  • 13. reading XML into Flash <ul><li>Easy loading of XML-files in Flash </li></ul><ul><li>SOAP also standard available </li></ul><ul><li>good book: Flash XML Applications by Joachim Bernhard Schnier, ISBN 9780240809175 </li></ul>
  • 14. Producing your own XML <ul><li>When only needing very few data once, you could directly query the Joomla!-database… </li></ul><ul><li>&lt;?PHP //maak xml-bestand voor Flash </li></ul><ul><li>header (&amp;quot;content-type:text/xml&amp;quot;); </li></ul><ul><li>print(&apos;&lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&gt;&apos;); </li></ul><ul><li>print(&apos;&lt;links&gt;&apos;); </li></ul><ul><li>//algemeen: database connectie e.d. </li></ul><ul><li>require_once(&amp;quot;configuration.php&amp;quot;); </li></ul><ul><li>$config=new JConfig; </li></ul><ul><li>$connection=mysql_connect($config-&gt;host, $config-&gt;user, $config-&gt;password); </li></ul><ul><li>mysql_select_db($config-&gt;db, $connection); </li></ul><ul><li>$query_a=&amp;quot;select * from &amp;quot;.$config-&gt;dbprefix.&amp;quot;menu where name=&apos;&amp;quot;; etcetera </li></ul><ul><li>and make some custom XML </li></ul>
  • 15. using feeds in Joomla! to produce XML (1) <ul><li>One way: from Joomla! to Flash </li></ul><ul><li>Project: FlashFeed (now: version 0.04) on www.youcanjoomla.com </li></ul><ul><li>Includes Actionscript 2 and 3 classes and a component to create feeds of articles and blog-views </li></ul><ul><li>but no menus (yet) </li></ul>
  • 16. using feeds in Joomla! to produce XML (2): menus <ul><li>modules like mod_mainmenu cannot have a XML-view… </li></ul><ul><li>So, you have to make a component to make a feed from your menus </li></ul><ul><li>an attempt in that direction: Byrd Web Design, com_menu_to_xml </li></ul><ul><li>you only need a front-end: component under constuction. </li></ul>
  • 17. using feeds in Joomla! to produce XML (3): example <ul><li>Jonathan Byrd (from his administrator/components/com_menu/controller.php): </li></ul><ul><li>$db-&gt;setQuery( &amp;quot;SELECT name, link FROM #__menu WHERE menutype=&apos;&amp;quot;. $type-&gt;menutype .&amp;quot;&apos;&amp;quot; ); </li></ul><ul><li>$items = $db-&gt;loadObjectList(); </li></ul><ul><li>$file= fopen( JPATH_COMPONENT_SITE.DS.&apos;XML&apos;.DS.$type-&gt;menutype.&amp;quot;.xml&amp;quot;, &amp;quot;w&amp;quot; ); </li></ul><ul><li>$_xml = &amp;quot;&lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&gt;&amp;quot;; </li></ul><ul><li>$_xml .= &amp;quot; &lt;menu&gt; &amp;quot;; </li></ul><ul><li>foreach( $items as $item ) { </li></ul><ul><li>$ss=&amp;quot;_parent&amp;quot;; </li></ul><ul><li>$url = str_replace( &apos;&amp;&apos;, &apos;&amp;amp;&apos;, $item-&gt;link ); </li></ul><ul><li>$name = str_replace( &apos;&amp;&apos;, &apos;&amp;amp;&apos;, $item-&gt;name ); </li></ul><ul><li>$_xml .= &amp;quot; &lt;item item_url=&amp;quot;&amp;quot;. $url .&amp;quot;&amp;quot; item_label=&amp;quot;&amp;quot;. $name .&amp;quot;&amp;quot; item_url_target=&amp;quot;&amp;quot;. $ss .&amp;quot;&amp;quot;&gt;&amp;quot;. $name .&amp;quot;&lt;/item&gt; &amp;quot;; </li></ul><ul><li>} </li></ul><ul><li>$_xml .= &amp;quot;&lt;/menu&gt;&amp;quot;; </li></ul>
  • 18. using feeds in Joomla! to produce XML (4): example <ul><li>Produces this XML (kind of RSS): </li></ul><ul><li>&lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&gt; </li></ul><ul><li>&lt;menu&gt; </li></ul><ul><li>&lt;item item_url=&amp;quot;index.php?option=com_content&amp;amp;view=frontpage&amp;quot; item_label=&amp;quot;Home&amp;quot; item_url_target=&amp;quot;_parent&amp;quot;&gt;Home&lt;/item&gt; </li></ul><ul><li>&lt;item item_url=&amp;quot;index.php?option=com_content&amp;amp;view=article&amp;amp;id=5&amp;quot; item_label=&amp;quot;Joomla! Licentie&amp;quot; item_url_target=&amp;quot;_parent&amp;quot;&gt;Joomla! Licentie&lt;/item&gt; </li></ul><ul><li>&lt;item item_url=&amp;quot;index.php?option=com_content&amp;amp;view=section&amp;amp;id=3&amp;quot; item_label=&amp;quot;FAQ&amp;quot; item_url_target=&amp;quot;_parent&amp;quot;&gt;FAQ&lt;/item&gt; </li></ul><ul><li>&lt;item item_url=&amp;quot;index.php?option=com_content&amp;amp;view=article&amp;amp;id=19&amp;quot; item_label=&amp;quot;Joomla! overzicht&amp;quot; item_url_target=&amp;quot;_parent&amp;quot;&gt;Joomla! overzicht&lt;/item&gt; </li></ul><ul><li>&lt;item item_url=&amp;quot;index.php?option=com_content&amp;amp;view=article&amp;amp;id=22&amp;quot; item_label=&amp;quot;Wat is nieuw in 1.5?&amp;quot; item_url_target=&amp;quot;_parent&amp;quot;&gt;Wat is nieuw in 1.5?&lt;/item&gt; </li></ul><ul><li>&lt;item item_url=&amp;quot;index.php?option=com_content&amp;amp;view=section&amp;amp;id=4&amp;quot; item_label=&amp;quot;Meer over Joomla!&amp;quot; item_url_target=&amp;quot;_parent&amp;quot;&gt;Meer over Joomla!&lt;/item&gt; </li></ul><ul><li>&lt;item item_url=&amp;quot;index.php?option=com_weblinks&amp;amp;view=categories&amp;quot; item_label=&amp;quot;Weblinks&amp;quot; item_url_target=&amp;quot;_parent&amp;quot;&gt;Weblinks&lt;/item&gt; </li></ul><ul><li>&lt;item item_url=&amp;quot;index.php?option=com_newsfeeds&amp;amp;view=categories&amp;quot; item_label=&amp;quot;Nieuws feeds&amp;quot; item_url_target=&amp;quot;_parent&amp;quot;&gt;Nieuws feeds&lt;/item&gt; </li></ul><ul><li>&lt;item item_url=&amp;quot;index.php?option=com_content&amp;amp;view=category&amp;amp;layout=blog&amp;amp;id=1&amp;quot; item_label=&amp;quot;Het nieuws&amp;quot; item_url_target=&amp;quot;_parent&amp;quot;&gt;Het nieuws&lt;/item&gt; </li></ul><ul><li>&lt;item item_url=&amp;quot;index.php?option=com_facileforms&amp;quot; item_label=&amp;quot;Contact&amp;quot; item_url_target=&amp;quot;_parent&amp;quot;&gt;Contact&lt;/item&gt; </li></ul><ul><li>&lt;item item_url=&amp;quot;index.php?option=com_jumi&amp;amp;fileid=1&amp;quot; item_label=&amp;quot;Hello Jumi!&amp;quot; item_url_target=&amp;quot;_parent&amp;quot;&gt;Hello Jumi!&lt;/item&gt; </li></ul><ul><li>&lt;/menu&gt; </li></ul>
  • 19. webservices <ul><li>Goal: bidirectional XML data-exchange </li></ul><ul><li>XML-RPC </li></ul><ul><li>SOAP: envelope and wsdl </li></ul><ul><li>RESTful webservices: resources </li></ul><ul><li>XML-RPC in Joomla 1.6 on the right spot at last: receiving data in a controller , producing data in a view , possibly using a common model . </li></ul>
  • 20. Flash and XML-RPC: 2 projects <ul><li>XML-RPC-lib (Pedro Ornelas): members.netmadeira.com/killer/xmlrpc </li></ul><ul><li>XML-RPC client for actionscript: sourceforce.net/projects/xmlrpcflash </li></ul>
  • 21. Joomla! en SOAP <ul><li>JMSOAP: Joomla SoapServer API unfortunately now only for Joomla1.0 </li></ul><ul><li>you can use other PHP SOAP-projects within Joomla! Possibilities: NuSoap, Pear::SOAP and PHP5 SOAP. </li></ul><ul><li>I am working on a Joomla-plugin </li></ul>
  • 22. TODO, under construction <ul><li>Joomla! component for menu-syndication </li></ul><ul><li>Joomla! SOAP-plugin (and REST) </li></ul><ul><li>re-use by standardisation </li></ul><ul><li>standard Actionscript classes to consume webservices (maybe also using AMF?) </li></ul>

×