Integrating with other Joomla Plugins

 

One of the many nice features of Fabrik is integrating with other Joomla plugins, the following example is making use of the Allvideo plugin for displaying multimedia.

As an example we will create the following list with two field elements, description and video1

 

 

Once installed the Allvideo plugin allows you to embed a YouVideo video in an article by using the following syntax.

 

 

Simply adding the above code inside a field element in Fabrik will display a YouTube video in your lists or forms just like it would in an article.

 


 

The result is the following.


 

YouTube Video

 

This syntax is probably okay if you are submitting the video links yourself but not so convenient if you want the end users to submit links.


To work around this and to provide a more user friendly way we can use the magic of the Calc element and placeholders.


Using this method we create the same field elements as above but also an additional calc element. This time instead of using the allvideo syntax we can type in the full URL, in this case www.youtube.com/watch?v=lqT6r_ELzZk


In the calc element we use the following code to copy the URL from the video2 element, extract the required video id and then form the correct syntax to allow the allvideo plugin to display the video.






Entering data would now look like this


 

The end result is the same as the first example but a more user friendly interface for entering URL's.


YouTube Video
www.youtube.com/watch?v=lqT6r_ELzZk

 




You probably wouldn't display the 'URL for Calc Plugin' element in detail view but it has been left in place for this example.

id
date time
2011-12-20 23:53:27