|
How to make our components to add the necessary Content Elements? |
|
|
|
|
Geschrieben von: Ivo Apostolov
|
|
Donnerstag, den 26. April 2007 um 01:36 Uhr |
|
Keine Übersetzungen vorhanden. OK, you need a simple hack in order to make your component install the necessary content element files, when the component is installed itself. - Put the content element files in a folder named "contentelements" for example
- 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.
|
Freitag, 15. Januar 2010
Donnerstag, 10. Dezember 2009
Donnerstag, 07. Mai 2009