Home Documentation
How to make our components to add the necessary Content Elements? PDF Print E-mail
Written by Ivo Apostolov   
Thursday, 26 April 2007 01:36
OK, you need a simple hack in order to make your component install the necessary content element files, when the component is installed itself.
  1. Put the content element files in a folder named "contentelements" for example
  2. In the function com_install in your file install.component_name.php you need to add the following lines of code:
if (file_exists($mosConfig_absolute_path . '/administrator/components
/com_joomfish/config.joomfish.php'))
{
@rename( "$mosConfig_absolute_path/administrator/components/com_component_name
/contentelements/ce_name.xml",
"$mosConfig_absolute_path/administrator/components/com_joomfish
/contentelements/ce_name.xml");
@rename( "$mosConfig_absolute_path/administrator/components
/com_component_name/contentelements/ce_name2.xml",
"$mosConfig_absolute_path/administrator/components/com_joomfish
/contentelements/ce_name2.xml");
@rmdir ("$mosConfig_absolute_path/administrator/components
/com_component_name/contentelements");
} else { @unlink( "$mosConfig_absolute_path/administrator
/components/com_component_name/contentelements/ce_name.xml" );
@unlink( "$mosConfig_absolute_path/administrator
/components/com_component_name/contentelements/ce_name2.xml" );
@rmdir ("$mosConfig_absolute_path/administrator
/components/com_component_name/contentelements"); }

Basicly this few lines of code, check if Joom!Fish is installed, and if so, it copies the necessary files to the right place. If not it delete the files.

Some advanced features might offer even a function those files to be added on a later stage from your component options, but this is probably the easiest way to have a build-in Joom!Fish Support.

 

3 Comments

  1. Need more details of making joomfish supported component. Can you provide a demo component? It would be nice for developers.
  2. A lot of Thanks for giving useful information...
  3. This is useful information, thanks a lot! Is there also a howto that teaches how to program the component in order to make it translateable with Joom!Fish? Would be great. Cheers, Peter

Add Comment

 
joomfish_2.0_download

Selected Contributors

From the Joom!Fish Core team (Alex, Geraint & Carolien) a big thank you to all the people of the JoomFish community!
A special thank to Harri for the moderation in the forum and all our translators.

Recommended Reading

Joomla! Entwicklerhandbuch