March
11
Flashfeed release 0.04
Info: FlashFeed is a project that enables the use of Joomla as backend to Adobe Flash sites. It is possible to edit and post your content in Joomla and feed it into a Flash movie, making Joomla an advanced CMS backend.
Today I've release the Flashfeed 0.04 release. The one major enhancement is that all parameters are now feeded in the xml. Try to click on the following links, and you will see the Flashfeed XML feed from this Joomla site:
View this article as XML:
http://www.youcanjoomla.com/index.php?option=com_content&view=article&id=52&format=xml
View this category as XML:
http://www.youcanjoomla.com/index.php?option=com_content&view=category&id=1&format=xml
View this section as XML
http://www.youcanjoomla.com/index.php?option=com_content&view=section&id=1&format=xml
View my frontpage as XML
http://www.youcanjoomla.com/index.php?option=com_content&view=frontpage&format=xml
The cool thing about this release is, that you're now able to add custom parameters to your articles, and these will show in the xml files too. Let's say you want a user attach images to the text they are writing in the articles. Flash can't handle <img> tags, so it won't work if the user inserts and image with the editor. But instead, just create an imagelist parameter in the administrator/components/com_content/models/article.xml file, and the user can now select an image to go with the text. And then you can load the image inside of Flash and do whatever you want. If you don't know how to add custom parameters to articles, take a look at my tutorial: image as article parameter.
Go to the downloads section to download the FlashFeed 0.04 release.
I'm planning on releasing the 1.0 version before summer, if I can get enough donations to be able to take some time off from my web freelancing duties. I'd also be glad to hear from anyone who's using the FlashFeed project. Your knowledge is really useful to future features / bugsquashing.
March
11
Flashfeed release 0.03
Info: FlashFeed is a project that enables the use of Joomla as backend to Adobe Flash sites. It is possible to edit and post your content in Joomla and feed it into a Flash movie, making Joomla an advanced CMS backend.
Today I've released a 0.03 version of the Flashfeed release. This has been a big step towards making Flashfeed a "real" Joomla extension. This time I've created the extension as a Joomla installer so it's easy to install on your Joomla sites. Simply download the com_flashfeed_003.zip file in the "Downloads" area and install it.
If you want to use your Joomla site as a backend to Flash, I've also added some new Flash classes. These can also be downloaded in the "Downloads" area. If you can't figure out how to make it all work, open the Example.fla and you will see a working example.
New Features
The new features in this release are:
- All XML handling is now done by the JSimpleXML class, which makes it PHP4 friendly
- You can now load all frontpage articles
- Metadata is feeded in article views
- Included install package
If you're not using the Flash classes, simple call the following urls to feed xml. Off course you have to target the index.php of your domain (e.g. www.yourjoomlasite.com/index.php......)
Article: (shows article with id = 1)
index.php?option=com_content&view=article&format=xml&id=1
Category: (shows all articles in category with id = 1)
index.php?option=com_content&view=category&format=xml&id=1
Sections: (shows all articles in section with id = 1)
index.php?option=com_content&view=section&format=xml&id=1
Frontpage: (shows all articles on frontpage)
index.php?option=com_content&view=frontpage&format=xml
Please remember that this is a 0.0x beta release, and use on production sites is at own risk!
The Flashfeed release works with SEF urls enabled and can be used with Joomfish. Simple write www.yourjoomlasite.com/en/index.php instead, and replace en with whatever language you have translated.
Go to the "Downloads" area to download the new release.
March
11
Custom Components and Joomfish 2.0
In this post i will try to explain how make your custom components work with Joomfish 2.0. Joomfish is an extra-ordinary extension for Joomla, that allows you to manually translate all your Joomla content. When installed, it works with all native Joomla content, but if you develop a custom component, you have to code a little bit yourself.
I will use the official "Hello World" component as example. For those of you who haven't read the tutorial, please refer to the Joomla Docs. Install the component available for download in part 4 of the tutorial, and we're ready to go.
Creating the Content Element XML for Joomfish
Joomfish uses XML files to know how to translate content elements. These content element XML files are located in administrator/components/com_joomfish/contentelements. All you have to do is make a new XML file and save it into this directory, and Joomfish will know how to translate the component. Let's explain how to build this new XML file step-by-step:
First, create a new XML file in your favourite code editor and save this as hello.xml in the contentelements folder. It is important that the XML file is named exactly as the component, and because our component is called com_hello, we call the file hello.
Write the following in the new XML-file:
<?xml version="1.0" ?>
<joomfish type="contentelement">
<name>Hello</name>
<author>Rune Skjoldborg Madsen</author>
<version>1.0</version>
<description>Definition for the Hello World component</description>
<reference type="content">
<table name="hello">
<field type="referenceid" name="id" translate="0">ID</field>
<field type="titletext" name="greeting" translate="1">Greeting</field>
</table>
</reference>
</joomfish>
The first 6 lines are just simple information to Joomfish. We declare the XML version, tell Joomfish that it's a new content element to translate, Tell the name of the component, the author name the version of the component, and a small description.
It is inside the <reference> tags we tell Joomfish what to translate. Inside the reference tags, we tell Joomfish what table to translate from. In our example, the Hello Component use a table called jos_hello, and therefore we write the following:
<table name="hello">
Inside the table tag, we have 2 field tags. The first tells Joomfish, that our column "id" is the primary key, and we set translate to 0, because we don't want the use to be able to translate the id of the greeting:
<field type="referenceid" name="id" translate="0">ID</field>
The next field tag is of the type "titletext", which tells Joomfish two things: 1) that the "greeting" column in our MySQL table holds data from a simple input field 2) That the "greeting" column should be used as the "title" field in the Joomfish component in the admin section. Offcourse we set the name corresponding to our MySQL column "greeting" and we also set the translate property to true:
<field type="titletext" name="greeting" translate="1">Greeting</field>
To get a definition of which fielstypes are available in Joomfish (such as "titletext, "text", so on), read the Creation of Content Elements tutorial. Now our component is ready for Joomfish translation, and we just need to fix some MySQL queries to make everything work.
Fixing MySQL queries in the hello component
When dealing with Joomfish, you always have to select your primary field when you do a query. Even though you don't actually use it, Joomfish needs it to be able to do the translation.
Open up the model file located in components/com_hello/models/hello.php. Find the following line:
$query = 'SELECT greeting FROM #__hello';
And replace it with:
$query = 'SELECT * FROM #__hello';
By doing this we also select the "id" column that Joomfish needs to translate the greeting.
And that's it! All you need is to go into the Joomfish Admin section and translate the greetings to whatever languages you have installed and activated. It's as easy as that.
Remember that the component only selects and shows the first greeting no matter what. If you want to see all greetings, you have to use the loadAssocList() function instead of the loadResult() function in the same model file as above. Then you're able to loop through the rows array in your view template file.
March
11
Flashfeed release 0.01
Info: FlashFeed is a project that enables the use of Joomla as backend to Adobe Flash sites. It is possible to edit and post your content in Joomla and feed it into a Flash movie, making Joomla an advanced CMS backend.
Finally I had some time off from my freelancing, and I spent a couple of days during Christmas testing my Flashfeed project. I decided to make a small .ZIP file, to be able to get some response. Notice, that this is a minor minor release, and I just putted it online for you to test.
The FlashFeed project is an attempt to build a strong and effective link between Flash and Joomla - that is to be able to use Joomla as backend to Flash. The final project will consist of a Joomla Installer Package AND a set of Actionscript 3 classes, so the Flash programmer doesn't have to mess around in Joomla all the time - all he has to do is to use the Actionscript 3 classes:
var joomlaData:FlashFeed = new FlashFeed("http://www.myjoomlasite.com");
joomlaData.addEventListener(Event.COMPLETE, handleData);
joomlaData.loadArticleByID(3);
function handleData(e:Event):void
{
// use article XML in joomlaData object
}
The above zip file has only 1 funtionality: It's possible to load and display article, category and section data. To use the files with your Joomla site (please, only for test purposes), do the following:
- Unzip the file and upload all of the contents to your Joomla root (make sure your FTp client merges the folders with your online folders of the same name)
- Test by calling the following URLS in your browser:
// where id is the article id to display
index.php?option=com_content&view=article&format=xml&id=1
// where id is the category id to display
index.php?option=com_content&view=category&format=xml&id=1
// where id is the section to display
index.php?option=com_content&view=section&format=xml&id=1
By using these URL's, you can actually get XML data from Joomla inside of Flash. And actionscript 3 test would look like this:
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, handleXML);
var urlString:String = "http://www.myjoomlasite.com/index.php?option=com_content&view=article&format=xml&id=1";
var request:URLRequest = new URLRequest(urlString);
loader.load(request);
function handleXML(e:Event):void
{
trace(loader.data); // output article xml from Joomla
}
Simple as that. Offcourse the final project will use the FlashFeed Actionscript 3 classes to make it even more convenient, but this should give you an idea of how FlashFeed will work.
Feel free to write comments and suggestions to me :-)
March
11
Movie or Flash objects disappearing?
Have you noticed that your embedded objects, such as Flash and video files are missing when upgrading to Joomla 1.5.8? The reason is, that this version introduces a blacklist filter that filters out many embedded objects in your article text. To void this, enter the article parameters and disable the blacklist for Super Administrators.
By doing this you can allow Super Administrators to embed video and Flash content, but disallow registered users on your site doing the same. It's actually a really smart option, but it's kind of a problem that people don't know that the blacklisting is a default feature that you have to disable.
March
11
Joomla logo revisited
Since I started using Joomla, I have always thought, that the project logo had the potential of becoming a nice logo, but lacked a bit of depth. Well, with 30 minutes on my hands and nothing to do, I tried redesigning the logo. I actually think it came out pretty nice. In the small box in the upper left corner, you can see the original logo.

March
11
Joomla as Flash backend, part 1
UPDATE: This article is outdated. Please go to www.youcanjoomla.com to check my FlashFeed component, that makes it a lot easier to handle XML from Joomla.
A couple of months ago, I had to create af full Flash site, with a CMS to edit the text content. In the coming tutorials, I'm going to explain some of the things you can do to make Joomla 1.5+ your Flash-buddy when it comes to feeding data.
A really simple solution
The most simple solution I can think of when wanting to get XML from flash, is to use the built-in RSS feeds. This is pretty straight-forward, and it doesn't take alot of setting up. I expect, that you have already installed your Joomla site.
Make your own Flash template
All you want the user to see is the Flash movie, and therefore we'll create a Joomla template holding nothing but your Flash movie. That is, make a Joomla template with nothing inside the <body> tags, just your embedded Flahs movie. Tell it to be 100% in width and 100% height. You might also want to set the body and html property in your CSS file to the same:
body, html {
height: 100%;
width: 100%;
margin:0;
padding:0;
}
Your template will basically look like this now:
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang=
"<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="/templates/system/css/system.css"
type="text/css" />
<link rel="stylesheet" href="/templates/system/css/general.css"
type="text/css" />
<style type="text/css">
html {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<!-- Embed your Flash movie here - I prefer using SWFObject 2.0 -->
</body>
</html>
Getting XML from within Flash
I your flash movie, you can simply call the Joomla URL you want to have feeded, and put "format=feed" behind it. So if you want all XML from the frontpage, simply call this inside flash:
index.php?format=feed
And if you want to feed all article inside of, let's say section with the id of 2:
index.php?option=com_content&view=section&id=2&format=feed
And that's actually it!
Conclusion
You now have basic feeding from Joomla to Flash. In the next tutorials, I'm going to show you what we can do to integrate this a littler better - and generally how Flash can benefit from using Joomla as backend.
March
11
Image as article parameter
Last year, I was making an online newspaper with Joomla, and I had to be able to send images as article parameters. Why? Because if you're only able to insert images into the article body, then you're quite handicapped when it comes to placing that images in a newspaper design. I wanted a frontpage where my article image was on top, then my author name and date, and then came the article text. This was not possible when inserting the article image into the article text.
What I found out was, that it's actually quite simple. All you have to do is locate the file: administrator/components/com_content/models/article.xml.
In this file is an XML list with all article parameters. If you want to be able to select an image from your default images/stories directory, then simply put this line into the "Advanced" group:
<params group="advanced">
<!--This is the line -->
<param name="articleimage" type="imagelist" directory="/images/stories"
hide_default="1" default="" label="Article Image" description="Image" />
<!-- End of line-->
Now, in your layout files inside of the html folder in your template, you're able to use this parameter to display the image whereever you want to. This is how you get the path to the image:
<?php if ($this->item->params->get('articleimage')) : ?>
<img src="/images/stories/<?=$this->item->params->get('articleimage')?>" />
<?php endif; ?>
It's a neat way to be able to control your images, and remember that you can make as many custom parameters as you want!
March
11
Main Menu with images only
The fact that you're able to show your menu modules with images only is something, that only recently became a part of Joomla. Because the settings are placed under your module in the Module Manager, people sometimes tend to forget it.
It's actually pretty simple:
- Upload your menu images to the images/stories directory
- When creating a menu item, be sure to select a menu image under "Parameters (System)"
- Go to the Module Manager and select your menu. Under "Other Parameters" set "Show Images" and "Menu Image Link" to yes.
Basically this will output something like, depending on how many menu items you have:
<ul class="menu">
<li><a href="mymenulink1"><img src="menuimage1.jpg" /></a></li>
<li><a href="mymenulink2"><img src="menuimage2.jpg" /></a></li>
<li><a href="mymenulink3"><img src="menuimage3.jpg" /></a></li>
<li><a href="mymenulink4"><img src="menuimage4.jpg" /></a></li>
<li><a href="mymenulink5"><img src="menuimage5.jpg" /></a></li>
</ul>
If you open your page in a browser window, you will se you menu images in a horizontal list. All you have to do now is to tell Joomla NOT to display the list. If you want a vertical menu, you need something like this in your CSS:
ul.menu {
padding: 0;
margin: 0;
}
ul.menu li {
list-style:none;
display:block;
}
If you want the menu images to form a horizontal menu, tell them to float left:
ul.menu li {
list-style:none;
float: left
display:block;
}
Remember, that if you float something, always clear the float afterwards. Or else, browsers will not display your page normally. I always put a <br class="clearfloat"> after my floated elements. This is the class CSS:
.clearfloat {
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
That's all you need to display a menu with images only. If you're looking for more features (such as rollover images or dynamic menu items) be sure to check out the Extended Menu extension.
March
11
Welcome to my Joomla blog
Hey everyone and welcome to my Joomla blog. I have felt the need to write a blog about Joomla for a long time, and now I finally found the time to design one. Working with Joomla, I have found that only a few larger blogs write about Joomla, and it's dificult to find al those useful tips & tricks about the system. With this blog I hope to have contributed just a little bit to a project, that I have benefitted from in a long time. Feel free to leave a comment if you want.


