Skip to main content

Static publish flash with Sourcerer in Joomla

29 June 2011


First, what is static publishing? The following is from the SWFobject documentation site:

SWFObject 2 offers two distinct methods to embed Flash Player content:

  1. The static publishing method embeds both Flash content and alternative content using standards compliant markup, and uses JavaScript to resolve the issues that markup alone cannot solve
  2. The dynamic publishing method is based on marked up alternative content and uses JavaScript to replace this content with Flash content if the minimal Flash Player version is installed and enough JavaScript support is available (similar like previous versions of SWFObject and UFO)

Well, there's that. Basically, with static publishing you place the complete embed code (object) in your html, as to where with dynamic publishing, you let your javascript handle that and you only publish a container in your html which will be replaced by the proper code.

Okay. Let's start with the html that came with the flash. It looks something like this:

{article Static publish of flash - start html}{title} {text} {/article}

So... we see some basic styling, it loads the swfobject script plus swffit script and sets some flashvars, parms and attributes. It uses an XML file for dynamic input and it uses expressinstall. Then, in the body, you see a div MyContent, which means this is dynamic publishing.

First, we are going to genereate proper code to publish this flash statically in our Joomlacontent. This means we need to adjust the path, assuming we uploaded all of our flash content into the Media Manager, path yoursite.nl/images/stories/flash/moviename. For this, we use a SWFObject 2 HTML and JavaScript generator, fill in the vars, parms and attributes as found in the original html. Here's how I filled the information in in the generator:

 swfobject-generator

 

Now when you hit the "generate" button, you'll get the html:

{article Static publish of flash - generated html}{title} {text} {/article}

 

Almost there. The final step is to put this stuff into your Joomla content. Open your Joomla article, and put your cursor in the editor where you want your flash movie to appead and press the editor button "Insert code" (the Sourcerer editor button). As instructed in the Sourcerer documentation, you put your code between the {source} tags.

There are two ways you can put the html code into your article, the first method is simply place the whole generated html between the tags:

{article Static publish of flash - sourcecode 1}{title} {text}{/article}

I have added the relative path to the media manager (images/stories/flash/yourmovie) to the files

Put the whole html in the Sourcerer edit window, and make sure it is between the tags

 

The second method is a bit more complicated. Here, we're going to put the stuff that belongs between the header tags of your page right where it belongs, and the embed code in the article itself.

{article Static publish of flash - sourcecode 2}{title} {text} {/article}

This is based on Peter's instructions on his forum. Again, place this code inside the Sourcerer edit window, between the proper tags.

 

And than it should work!



 


Gerelateerde links

Onderwerp

Tag

flash
Sourcerer

Hits

2034