Plugin installation, How to add images? - joomla

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>

Related

How to add an icon to a nuget package?

We are hosting our own nuget server through Teamcity. Is there any other way to add an icon to a .nuspec file other than specifying a web url (http://....)?
Or is there a place in Teamcity that these icons could be hosted?
As of NuGet 5.3.0 you can now use <icon> to provide a relative path to your JPEG or PNG icon file located within your package.
<package>
<metadata>
...
<icon>images\icon.png</icon>
...
</metadata>
<files>
...
<file src="..\icon.png" target="images\" />
...
</files>
</package>
Source: https://learn.microsoft.com/en-us/nuget/reference/nuspec#icon
<iconUrl> is now deprecated.
If you have your icon in a GitHub repository, you can locate it on GitHub.com, right click and "Copy image address". Then place this in your .nuspec. This worked for me:
<iconUrl>https://github.com/tcs1896/SharpChecker/blob/master/SharpChecker/SharpChecker/SharpChecker/Icon.png?raw=true</iconUrl>
No, this is the only option using the iconUrl property - See the NuSpec Reference
I would generally choose to host shared images like this on a CDN service rather than TeamCity - CloudFlare provide a free service.
The Documentation is as following
PackageIconUrl is deprecated in favor of the PackageIcon property Starting with NuGet 5.3 and Visual Studio 2019 version 16.3
So the way to do it is to add the following to your .csproj
<PropertyGroup>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
<None Include="YOUR_PATH_TO_ICON\icon.png" Pack="true" PackagePath="\" />
</ItemGroup>
You can host icons on your TeamCity server, quoting Orn Kristjansson in TeamCity to serve static HTML page:
It's a Tomcat server, just go on your file system where you installed Teamcity and you should be able to find out where you can park some html that will then be available on the Teamcity urls.
So copy your icons into C:\...\TeamCity\webapps\ROOT\ and the will be served as static files.
I have a work around solution. I tried successfully on windows 10. It is useful if you have to install your application on the offline PC, without internet.
step 1:
add tag to the content of nuspec file. Something like the following:
<metadata>
<id>....</id>
...
<iconUrl>file://C:\app.ico</iconUrl>
...
<copyright>....</copyright>
</metadata>
step 2: generate the nupkg file from the above nuspec
step 3: generate the exe file from nupkg file
step 4:
put the app.ico file at location: C:\app.ico . You can choose any location according to <iconUrl> in the nuspec file. Almost windows PC have "C" drive disk. So that it is comfortable to install .exe in the other PC if you use "C" drive).
step 5: run exe file to install application on PC.
========= RESULT =============
At C:\Users\"user_name"\AppData\Local\"app_name" you can see the app.ico appears on the installed application folder.
I hope it may help you!
You can add file to nuspec content folder and specify link in such manner:
"file://content/images/icon.ico"
You can find more info here: Packages containing Icon and License

How to upload magento extension in Magento Connect?

I want to upload my own extension in Magento connect, but i am not able to upload zip file in Magento Connect. While uploading my module error is display " Unable to save version. Disallowed extension release file type. "
Any body have any idea, so please let me know.
Thanks in advance.
Your extension has to be of filetype extension .tgz as this is prescribed in Magento. There are online tools to convert .zip to .tgz like this site.
Also check this manual from Magento about how to package Magento Connect Extensions.
It seems the zip file you have is not a Magento package. You can use the Magento Connect Manager to upload only valid Magento packages containing a package.xml file in the correct format, including the <contents> element containing the extension files.
In the case you have a package.xml file having a structure like this one:
<?xml version="1.0"?>
<package>
<name>...</name>
<version>.</version>
...
<contents>...</contents>
...
</package>
try to recreate the package as a .tgz file by placing the package.xml in the root and the other files in their respective places relatively to the root.
In the case you do not have a package.xml file, I would advise you to consider installing the extension manually by coping its files to their respective places in your Magento installation.

Magento2 changes

Hi I am new in Magento 2 and I want to know where I have to put the
vendor/magento/module-theme/view/frontend/layout/default.xml file, I tried to copy the file and put it in c:\wamp\www\kk2\app\design\frontend\Magento\MyStore\layout
folder and is not working. I also tried in c:\wamp\www\kk2\app\design\frontend\Magento\MyStore\module-theme\layout and other options but I can't figure where I have to put this to start modifying the theme, the documentation on the Magento offical page is not very clear.
You do not need to copy any file. You can create your own theme.
Quoting steps in create a theme
Create a directory for the theme under app/design/frontend/<your_vendor_name>/<your_theme_name>.
Add a declaration file theme.xml and optionally create etc directory and create a file named view.xml to the theme directory.
Add a composer.json file.
Add registration.php.
Create directories for CSS, JavaScript, images, and fonts. Configure your theme in the Admin
panel.
The Luma theme is not designed to be inherited from. Please see this comment on Github. You can however, inherit from the blank theme as follows:
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>New theme</title> <!-- your theme's name -->
<parent>Magento/blank</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
<media>
<preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
</media>
Create folder and copy default.xml file in your theme
app/design/frontend/magento/<your_theme_name>/magento_theme/layout/default.xml
remove generate folder and run
sudo php -f bin/magento setup:static-content:deploy
It's working

Creating and populating subfolders Joomla manifest XML

I've become fairly confused when I'm trying to create a subfolder and populate it with things in my plugin manifest XML.
If I want to create a subfolder and at the same time add files to it, how would that be done? Read comments in the code draft (all names are of course more distinct than used here).
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" version="2.5.0" group="group" method="upgrade">
<name>Handelsbanken Finans Delbetalning</name>
<!-- The following elements are optional and free of formatting conttraints -->
<creationDate>July 2013</creationDate>
<author>Emil Carlsson</author>
<authorUrl>http://valid.url</authorUrl>
<copyright>Copyright (C) 2013</copyright>
<version status="BETA">0.0.1</version>
<!-- The description is optional and defaults to the name -->
<description>Plugin description.</description>
<update> <!-- Runs on update; New in 1.6 -->
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>
<!-- Site Main File Copy Section -->
<!-- Note the folder attribute: This attribute describes the folder
to copy FROM in the package to install therefore files copied
in this section are copied from /site/ in the package -->
<files folder="site">
<filename>plgName.xml</filename>
<filename>plgName.php</filename>
<folder>helpers</folder>
</files>
</extension>
This gives me nothing really. I can't find the folder I shouldhave been created from what I gathered from the documentation. It also doesn't specifies how I populate these folder :(. I am assuming that it is possible to more or less just package all files I want and then it will create the subfolders where I want/need them. But that it is a question of how to write the manifest file. If anyone have a good tutorial about this I would be very thankful :). I've googled until my fingers are almost at the Point of bleeding :(. I guess I could put all the files in the same folder, but I want to have some sort of structure to visualize for other developers what's part of the core of the plugin and what's not part of the plugin core.
Problem is solved. In my not installation script I linked in the files for what I thought only was used by the configuration XML (a field to configurate the plugin). In this file I had the node "files" as well, in this node I'd not linked in the helpers directory. When this was done all the subdirectories was added as well. So in short - Don't forget to link in the folder in all places where you have a files-node.

Joomla 2.5 module won't upload media folder

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>

Resources