0

I did refer here: Joomla plugin install xml -- install file to different folder

<media destination="com_helloworld">
    <filename>image.png</filename>
    <filename>flash.swf</filename>
</media>

What does this mean? destination="com_helloworld"I want images to be inside my plugin folder to be installed..How do I change my existing xml below? The images folder is in same directory as js and cs

 <files>
        <filename plugin="chat">chat.php</filename>
        <filename>js/jquery.js</filename>
        <filename>js/chat.js</filename>
        <filename>css/style.css</filename>
        <filename>index.html</filename>
    </files>

Doing this:

<media destination="com_helloworld">
        <filename>images/people.png</filename>
        <filename>images/sound.swf</filename>
    </media>

Says: Unable to copy file from source...

Community
  • 1
  • 1
112233
  • 2,406
  • 3
  • 38
  • 88

2 Answers2

1

The destination info creates a new folder and add your files in there.

Try with file:

<files>
        <filename>image.jpg</filename>
        <filename>image.png</filename>
</files>
Mat5hias
  • 62
  • 9
1

As per @Math5hias answer, you can use the <media> tag to install files into Joomla default media folder (which is /media).

If you add the destination attribute, an additional subfolder will be created, i.e. /media/your_plugin_name. If you are ok with putting your images in the /media root, you don't have to use this attribute.

If it's not working in your case, make sure images are included in your zip file, it sounds like it's not.

Finally, you can also create an install script to your plugin, to perform additional custom task, e.g. to copy / move files from media to images. Official Joomla documentation: https://docs.joomla.org/J3.x:Developing_an_MVC_Component/Adding_an_install-uninstall-update_script_file

Francesco Abeni
  • 4,190
  • 1
  • 19
  • 30