Joomla plugin install xml — install file to different folder

喜欢而已 提交于 2019-12-24 11:42:01

问题


Is it possible to install a file from a Joomla plugin to a non-plugin directory?

For example-- by default a Joomla plugin install xml looks like this:

<?xml version="1.0" encoding="utf-8"?>
<install version="1.5" type="plugin" group="mycomponent" method="upgrade">
<name>MyPlugin</name>
<author>Me Myself</author>
<creationDate>January 29, 2011</creationDate>
<copyright>Copyright (C) 2011 ME</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<authorEmail>me@mysite.com</authorEmail>
<authorUrl>www.mysite.com</authorUrl>
<version>1.5</version>
<description>My cool plugin.</description>
<files>
    <filename plugin="myplugin">myplugin.php</filename>
</files>
<params />
</install>

This will install the myplugin.php file to the /plugins/mycomponent plugins folder.

However, if I want to install some image files to make my plugin look nicer, and want to drop those in the /images folder, is there a way to supply that path?

Thanks


回答1:


<!-- Site Main Media File Copy Section -->
    <media destination="com_helloworld">
        <filename>image.png</filename>
        <filename>flash.swf</filename>
    </media>

http://docs.joomla.org/Components:xml_installfile




回答2:


<files>
    <filename plugin="myplugin">myplugin.php</filename>
    <folder>dummyFolder</folder>
</files>

In this way you can add dummyFolder to plugins=>mycomponent=>dummyfolder



来源:https://stackoverflow.com/questions/5157771/joomla-plugin-install-xml-install-file-to-different-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!