I'm trying to create a package of a range of components, modules, plugins, templates and media files which are standard for most website that I create. I was wondering if the .xml file can handle all of this and if so. Which is the best way to go about it. So far this is what I have:

<creationDate>May 2016</creationDate>
<description>Package contains all components, plugins and modules</description>

<files folder="packages">
    <file type="component" id="com_aclmanager" >com_aclmanager.zip</file>
    <file type="component" id="admin_menu_manager" >com_admin-menu-manager.zip</file>
    <file type="component" id="jce" >com_jce.zip</file>
    <file type="plugin" id="plg_mtcustompagedata" group="system">plg_mtcustompagedata.zip</file>
    <file type="plugin" id="plg_mtcustompagefields" group="system">plg_mtcustompagefields.zip</file>
    <file type="plugin" id="plg_mtmodule" group="system">plg_mtmodule.zip</file>
    <file type="plugin" id="plg_mtredirect" group="system">plg_mtredirect.zip</file>
    <file type="plugin" id="plg_mtuserdata" group="system">plg_mtuserdata.zip</file>

<media folder="packages" destination="mt_media">

        <file charset="utf8" driver="mysql">install.mysql.sql</file>
        <file charset="utf8" driver="mysql">uninstall.mysql.sql</file>

It seems to completely miss the media files. And when I add templates in it also doesn't find those.


1 Answer 1


As far as I know, <media> does not accept zip files in <filename>.

I think you best options will be to create a script.php and use the postinstall() function to:

  1. Move the zip file to the media directory
  2. Extract the zip file
  3. Delete the zip file

Take a look at Adding an install/uninstall/update script file for more information

  • Ah ok thank you, so with this method. I have all of my plugins and modules in a folder. Can I just use one function to install them all in one go. or will I need code an install for each seperately? Thanks again though. That first answer helped alot.
    – HumanPew
    May 13, 2016 at 9:55
  • @HumanPew - Well each extension can have it's own media files but they're defined in the actual extension XML file, not your package XML file. I was under the impression that your own images were not associated with the extension and were things like banners, etc. Could you confirm the purpose of the custom media files?
    – Lodder
    May 13, 2016 at 10:25
  • Yes they will be banners and logos etc, that part is fine. I was meaning more the components and plugins side of it really. As in, with php can I get my script file to open my "packages" folder and search the zip files for an xml install file. And if it finds it, execute said file.
    – HumanPew
    May 13, 2016 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.