Joomla 2.5 module won't upload media folder - joomla

How do I upload a css file in my Joomla module? The manifest file is:
<files>
<filename>mod_wforcsliderresz.xml</filename>
<filename module="mod_wforcsliderresz">mod_wforcsliderresz.php</filename>
<filename>index.html</filename>
<filename>helper.php</filename>
<folder>tmpl</folder>
</files>
<media folder="media" destination="mod_wforcsliderresz">
<folder>css4c</folder>
</media>
<languages>
<!-- Any language files included with the module -->
<language tag="en-GB">en-GB.mod_wforcsliderresz.ini</language>
</languages>
I can overcome the problem by uploading the css directly but that's no good as a long term solution.
I've checked through FTP for the newly created folder media/mod_wforcsliderresz/css but there is no mod_wforcsliderresz subfolder within media.
I also tried to add a cssstfff above the tmpl definition but that wouldn't work. Any help would be great.

I think your css folder
css4c (if it exists) , is uploaded tomedia/media/mod_wforcsliderresz/css4c
Note that it's media/media.If you would remove
folder="media" from <media folder="media" destination="mod_wforcsliderresz">
then it would be in media/mod_wforcsliderresz/css4c.

Try changing this:
<media folder="media" destination="mod_wforcsliderresz">
<folder>css4c</folder>
</media>
to this:
<media folder="mod_wforcsliderresz">
<folder>css4c</folder>
</media>

Related

Prevent content files to be added on Nuget restore

We have some executables which we need to create our setups. So we have packed
the external dependencies which are some .exe files into a nuget package. But on NuGet restore they are added to project root.
How can we achieve this ?
Have searched around but haven't found any solution so far.
Since we use nuspec file, this is what i have it as:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>VCRedistributable</id>
<version>$version$</version>
<title>VCRedistributable</title>
<authors>--</authors>
<owners>--</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>InstallVCRedistributable assemblies</description>
<contentFiles>
<files include="**" exclude="**" buildAction="None" copyToOutput="false"
/>
</contentFiles>
</metadata>
<files>
<file src="VC\x86\*.*" target="content\x86" />
<file src="VC\x64\*.*" target="content\x64" />
</files>
Any ideas ?
Prevent content files to be added on Nuget restore
You should target to the tools folder instead of content folder.
So, your .nupsec file should be:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>VCRedistributable</id>
<version>$version$</version>
<title>VCRedistributable</title>
<authors>--</authors>
<owners>--</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>InstallVCRedistributable assemblies</description>
</metadata>
<files>
<file src="VC\x86\*.*" target="tools\x86" />
<file src="VC\x64\*.*" target="tools\x64" />
</files>
</package>
That because the content directory is a convention-based working directory, which contents are copied to the project root:
Convention-based working directory:
Besides, if you nuget package just include external some .exe files, you do not have to add the contentFiles label, this label is used for the content file for packagereference.
<contentFiles>
<files include="**" exclude="**" buildAction="None" copyToOutput="false"
/>
</contentFiles>
If you are interested in, you can check this document for some more details.
Update:
Is it good convention to create our own folder structure other than
NuGet defined since based on the tools folder description from above
it seems they will be accessible via Package Manager Console.
Of course, you can use your own folder structure other than NuGet defined. But you need to notice that there will be a limit to do this. You can NOT just include your own folder structure, you need also need add a NuGet defined folder structure in your .nuspec, otherwise, nuget will install failed with the error like:
Could not install package 'MyCustomPackage 1.0.0'. You are trying to
install this package into a project that targets
'.NETFramework,Version=v4.6.1', but the package does not contain any
assembly references or content files that are compatible with that
framework.
Because nuget did not detect that you added assembly references or content files to the project.
Hope this helps.

Plugin installation, How to add images?

I'm creating Joomla plugin (3.3 version) and I want to add some images to /images/ folder when installing plugin. Is there a way to add them trough manifest file, or I have to create installation file ?
You can definitely add them through the manifest file the same way you add images to components.
<files folder="site">
<folder>images</folder>
</files>

Joomla module. Unable to install language .ini files properly

I made a very simple joomla 3.2 module, but i can not manage to install my language .ini and sys.ini files.
Part of my .xml file
<files>
<filename>mod_myModuleTitle.xml</filename>
<filename module="mod_myModuleTitle">mod_myModuleTitle.php</filename>
<filename>index.html</filename>
<filename>helper.php</filename>
<folder>lib</folder>
<folder>tmpl</folder>
</files>
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.mod_myModuleTitle.ini></language>
<language tag="en-GB">en-GB/en-GB.mod_myModuleTitle.sys.ini></language>
<language tag="it-IT">it-IT/it-IT.mod_myModuleTitle.ini></language>
<language tag="it-IT">it-IT/it-IT.mod_myModuleTitle.sys.ini></language>
</languages>
the ini files are inside myModuleTitle/language/en-GB folder and myModuleTitle/language/it-IT folder
Trying installing I got:
Warning JInstaller: :Install: File does not exist path/to/my/local/web/server/tmp/mod_myModuleTitle/language/en-GB/en-GB.mod_myModuleTitle.ini
EDIT
SOLVED!!!
adding tag
<folder>language</folder>
and removing
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.mod_myModuleTitle.ini></language>
<language tag="en-GB">en-GB/en-GB.mod_myModuleTitle.sys.ini></language>
<language tag="it-IT">it-IT/it-IT.mod_myModuleTitle.ini></language>
<language tag="it-IT">it-IT/it-IT.mod_myModuleTitle.sys.ini></language>
</languages>
solved my problem, languages .ini files are installed and used correctly.
Glad you worked it out, for others looking at this question, the <language> element was deprecated in Joomla 1.6, the recommended approach since then has been for all language files (normal and system) to be stored with the extension.
You can read more about it in Language section of the Manfest files article on the Joomla Doc's site.

newly created template's templateDetails.xml is not working in joomla 1.5

I've created a joomla templates. As instructed I have placed my files and folders inside and linked to css file in index.php but when I cut up all the text in templateDetails.xml it is still showing as previous in the browsers and also at positions even after doing a clean refresh. Why is it taking its position and css, I'm surprised.
Edit
as per comments I have been placing my templateDetails.xml contents
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 1.5//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/1.5/template-install.dtd">
<install version="1.5" type="template">
<name>bini7a</name>
<creationDate>Mon, Jun-10, 2013</creationDate>
<author>Bhojendra Rauniyar</author>
<authorEmail></authorEmail>
<authorUrl></authorUrl>
<copyright>Bhojendra Rauniyar</copyright>
<license>GNU/GPL</license>
<version>1.0</version>
<description>bini7a: Bhojendra Template</description>
<files>
<filename>index.php</filename>
<filename>templateDetails.xml</filename>
<folder>images</folder>
<folder>css</folder>
</files>
<positions>
<position>headera1</position>
<position>headera2</position>
<position>mid</position>
<position>headerb1</position>
<position>headerc1</position>
<position>headerd</position>
<position>left</position>
<position>right</position>
</positions>
</install>
But even if I delete all these all the positions work correctly as defined position and also the css
The positions specified within Joomla's templateDetails.xml are only really needed when configuring module positions within the administrator's Module Manager. Once the position has been set it would appear the templateDetails.xml file does not need to be referenced again to display the module in that requested position.
To remove these positions permanently, either uninstall the template and reinstall with the new XML file or (the better) remove the positions from the template's index.php file.
You're looking for JDoc statements like the below:
<jdoc:include type="modules" name="headera1" />
See http://docs.joomla.org/Jdoc_statements for more information on the JDoc statements.
I hope this helps solve your dilemma.

Joomla | Module internationalization | New developer

I try to create a very simple module in Joomla. While my whole code is correct, and the module working properly, I cannot make it support the I18n feature.
More specific, my module directory is like that:
mod_mymodname:
languages:
en-GB.mod_mymodname.ini
mod_mymodname.php
mod_mymodname.xml
and then in my mod_mymodname.xml I have that code :
<?xml version="1.1" encoding="utf-8"?>
<extension type="module" version="2.5.0" client="site">
<name>MyModName</name>
... Other Options ...
<files>
<filename module="mod_mymodname">mod_mymodname.php</filename>
<filename>mod_mymodname.xml</filename>
</files>
<languages folder="languages">
<language tag="en-GB">en-GB.mod_mod_mymodname.ini</language>
</languages>
<config>
<fields name="params">
<fieldset name="basic">
<field name="modid" size="50" type="text" label="MODID" description="Description here" />
</fieldset>
</fields>
</config>
</extensions>
and my en-GB.mod_mymodname.ini has that content in it
MODID=Module ID
The problem is that in my admin section the field label has the value of "MODID" instead of "Module ID"
Is there anything wrong with that ? Is my first Joomla module, and I am not sure if everything is correct.
Note : The module doesn't require any translation in the front-end. I only need I18n for the administration section.
make sure you mentioned correct text for MODID in language file.
en-GB.mod_mymodname.ini ---> This file was used for declaring the text what we given in that module
Just add the following line in en-GB.mod_mymodname.ini this language file.
MODID="Module ID"
Save and check the module.. Hope this will work....
language file need to be in joomla language folder. If you had installed the module from admin then check the language folder and check if your file exists there.
check in administrator/languages/en-GB/
also you may have to change the way you have mentioned language files in your xml.
Have a look at this link for more detailed description
http://docs.joomla.org/Specification_of_language_files#Language_file_naming_conventions_and_precedence
Make sure you also have en-GB.mod_mymodname.sys.ini for translating text coming from the xml.
I thought of something else too. There does seem to be a known issue where for certain strings from the xml are only translated when the language file is in the main language folder rather than the extension language folder. So I usually put copies both places even though it's considered bad practice to put extension files in the core folder.
first add your module.xml language tag
<languages folder="languages">
<language tag="fr-FR">fr-FR.mod_mod_mymodname.ini</language>
<language tag="fr-FR">fr-FR.mod_mod_mymodname.sys.ini</language>
</languages>
then create two new file in your module language folder
fr-FR.mod_mod_mymodname.ini
fr-FR.mod_mod_mymodname.sys.ini
add the text you want to translate in .ini file like
MOD_MYMODULE_USERNAME="this is my mod"
Then add this constant value to your module default.php file like
JText::_ ('MOD_MYMODULE_USERNAME')

Resources