Flash Templates- Joomla!Days NL 2009 #jd09nl

  • Published on
    16-Apr-2017

  • View
    3.059

  • Download
    1

Embed Size (px)

Transcript

  • Flash templates for Joomla!Using XML for data-exchangeHerman PeerenDutch Joomla!Days, June 13, 2009

  • Herman PeerenCreating is manipulatingStandards, interfaces and Open Sourcewhy I like Joomla!and Flash

    herman@yepr.nl

  • Flash (dis)advantages - and solutionsdata-exchange with J-AMFPHPusing XML for data-exchangereading XML into Flashusing feeds from Joomla! to produce XMLusing webservices for two-way exchangeTODO, under construction

    Flash templates for Joomla!Agenda:

  • Flash (dis)advantagesgreat scaling to screenbrowser independantalpha-transparancy; no matte-dramafont embeddingmovement & soundActionscript: familiar and mature language

    SEO more difficultless CSS-supportno back-buttonno easy event trackingyou need extra provisions in case Flash Player is missing

    +-

  • IE-6 CSS-bugs: who cares?

    Some of my customers websites still have > 15% IE6-visitors! (yes, in 2009)professional websites/webapplications cannot ignore IE6, UNFORTUNATELY.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.

  • Excursion: template override to avoid multiple classes bugPart of overriding mod_mainmenu://geef class="itemNrX" mee aan li- en anker-tag (met X = hoeveelste item) bij level==1 (hoogste niveau)$x=1;if (($node->name() == 'ul') && ($node->attributes('class')!='menualgemeen')) {foreach ($node->children() as $child){if (($child->name() == 'li') &&($child->attributes('level')==1)) {//hang die class aan de liif ($child->attributes('class')) {$child->addAttribute('class', $child->attributes('class').' itemNr'.$x);} else {$child->addAttribute('class', 'itemNr'.$x);} //en aan de bijbehorende anchor-tag TO AVOID MULTIPLE CLASSES BUGforeach ($child->children() as $grchild){if ($grchild->name() == 'a') {$grchild->addAttribute('class', 'itemNr'.$x);}}$x++;}}}

  • More HTML in Flash textfieldFPXHTMLRENDER 1.2.2:sourceforge.net/projects/fpxhtmlrenderbeware of the mafia...To use with Joomla! back-end, see:stevenstark.com/images/flash+cms.pdf

  • Google in the Middle AgesIsidorus of Seville(560 - 636)

  • Better SEO: HTML-layermake a HTML-layer under a Flash-layereasy to do with a CMSyou can even put some EXTRA text thereBTW: trick of using content double in a template can sometimes be handy

  • More SEO for FlashFlash Actionscript cooperates very well with JavaScript You can track events and trigger JavaScript to make bookmarkable URLs, get conversion code etc.nice article about this subject (in Dutch):

    http://naarvoren.nl/artikel/flash_en_javascript

  • data-exchange with J-AMFPHPAMF: Action Message Format = a binary format for data exchange with Flashcan communicate with webservicesAMF and PHP: amfphp.org; used in J-AMFPHPat this moment THE way to exchange data between Joomla! and Flashfigo.tandolin.co.za/adobe-air/how-to-use-jamfphp-for-joomla-remoting.htm

  • Using XML for data exchangebroader standard, which can also be used to exchange data with other programslooking for a more universal interface

  • reading XML into FlashEasy loading of XML-files in FlashSOAP also standard availablegood book: Flash XML Applications by Joachim Bernhard Schnier, ISBN 9780240809175

  • Producing your own XMLWhen only needing very few data once, you could directly query the Joomla!-database

    host, $config->user, $config->password);mysql_select_db($config->db, $connection);$query_a="select * from ".$config->dbprefix."menu where name='";etceteraand make some custom XML

  • using feeds in Joomla! to produce XML (1)One way: from Joomla! to FlashProject: FlashFeed (now: version 0.04) on www.youcanjoomla.comIncludes Actionscript 2 and 3 classes and a component to create feeds of articles and blog-views but no menus (yet)

  • using feeds in Joomla! to produce XML (2): menusmodules like mod_mainmenu cannot have a XML-viewSo, you have to make a component to make a feed from your menusan attempt in that direction: Byrd Web Design, com_menu_to_xmlyou only need a front-end: component under constuction.

  • using feeds in Joomla! to produce XML (3): exampleJonathan Byrd (from his administrator/components/com_menu/controller.php):

    $db->setQuery( "SELECT name, link FROM #__menu WHERE menutype='". $type->menutype ."'" );$items = $db->loadObjectList();$file= fopen( JPATH_COMPONENT_SITE.DS.'XML'.DS.$type->menutype.".xml", "w" );$_xml = "";$_xml .= "\r\n\r\n";foreach( $items as $item ) {$ss="_parent";$url = str_replace( '&', '&', $item->link );$name = str_replace( '&', '&', $item->name );$_xml .= "\t". $name ."\r\n";}$_xml .= "";

  • using feeds in Joomla! to produce XML (4): exampleProduces this XML (kind of RSS):

    HomeJoomla! LicentieFAQJoomla! overzichtWat is nieuw in 1.5?Meer over Joomla!WeblinksNieuws feedsHet nieuwsContactHello Jumi!

  • webservicesGoal: bidirectional XML data-exchangeXML-RPCSOAP: envelope and wsdlRESTful webservices: resourcesXML-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.

  • Flash and XML-RPC: 2 projectsXML-RPC-lib (Pedro Ornelas): members.netmadeira.com/killer/xmlrpcXML-RPC client for actionscript: sourceforce.net/projects/xmlrpcflash

  • Joomla! en SOAPJMSOAP: Joomla SoapServer APIunfortunately now only for Joomla1.0you can use other PHP SOAP-projects within Joomla! Possibilities: NuSoap, Pear::SOAP and PHP5 SOAP.I am working on a Joomla-plugin

  • TODO, under constructionJoomla! component for menu-syndicationJoomla! SOAP-plugin (and REST)re-use by standardisationstandard Actionscript classes to consume webservices (maybe also using AMF?)