Joomla: Updated module is not reading from the language file - joomla

I have made some changes to my custom module's xml manifest file and also added new entries in the module's language file but the new language entries are not translated when I edit the module.
In the language file, I added a new entry such as:
MOD_MY_MODULE_LABEL="This is a label"
When I edit the module, all I can see is MOD_MY_MODULE_LABEL. I've refreshed the cache for the module from the Extension Manager but it's not reading the new changes. Am I missing something?

Once your template has been "installed", the language file in your template is no longer referenced. You need to open the following INI files:
/[ROOT]/language/en-GB/en-GB.tpl_[-=YourTemplate=-].ini
/[ROOT]/language/en-GB/en-GB.tpl_[-=YourTemplate=-].sys.ini
(Where [ROOT] is the dir you installed Joomla, and [-=YourTemplate=-] is the name you assigned your language files, they will be named exactly to the language files in your template, but in a different location for the Joomla system)
If you decide to take your template to another website (like another client) remember to grab those INIs and swap them out in your template folder

The proper method is like follows,
In your module xml file should have language file like follows.
<languages>
<language tag="en-GB">en-GB.mod_latesttweets.ini</language>
<language tag="en-GB">en-GB.mod_latesttweets.sys.ini</language>
</languages>
and your fields like.
<field name="consumer_key" type="text" default="" label="MOD_TWITTER_CONSUMER_KEY" description="MOD_TWITTER_CONSUMER_KEY_DESC" size="60"/>
Then module folder have these two files.
en-GB.mod_latesttweets.ini
en-GB.mod_latesttweets.sys.ini
Inside language file like below.
MOD_TWITTER_CONSUMER_KEY = "Consumer Key"
Then Joomla will place this file in the proper language folder while you install the module.
Once you have installed the module and needs to change the language labels. Should be change inside Joomla language folder file.
You can download a sample module from this link and check the structure.
The issue look like your language file does not exists.
Hope its helps..

Related

How to create custom SwiftUI View playground template in Xcode?

I want to create a custom Xcode playground template for SwiftUI View.
What file formats are used?
How can I find examples?
Where should I put those files?
You can make template by duplicating file templates at path
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/Playground
Note that each platform has it's own templates.
Copy two folders TEMPLATE_NAME.xctemplate and TEMPLATE_NAME___FileMenu.xctemplate
to ~/Library/Developer/Xcode/Templates/File Templates and rename them as you want.
(you can put it in subfolder SwiftUI, it's name will be used to separate your templates from others)
To change the displayed name of template you can change Name field in TemplateInfo.plist
Paste the code of your template into ___FILEBASENAME___.playground file (you can use placeholders to generate code base on parameters, see for example this article)
Here are my templates as an example: https://github.com/DanSkeel/XcodeTemplates/tree/main/Playground
Note: ...___FileMenu.xctemplate files will be used when you create new file from opened playground.

Magento Templates - Can extensions be bundled with a theme?

I have a real noob Magento question. I'm helping a friend change the template their store is using but they are worried about losing the functionality of some of their extensions such as ajaxsearch. They don't know if it's actually an extension or part of the template. I can't seem to figure out if some of the extensions are built into the theme or if they are completely separate extensions. Is there an easy way to tell?
To give an example the ajaxsearch JS file's path seems to in the template path e.g http://www.example.com/skin/frontend/default/templatename/js/ajaxsearch.js
and if I go to system > configuration I can see it listed in the sidebar under Templates-Master (which I think is a brand name). In this case is this an extension and is this how file paths work for extensions? The fact that skin is in the file path is throwing me off.
Thanks!
Fast way:
Each Magento extension provided as archive (.tgz). Unpack it to some folder outside Magento and check have it next path or not:
unpacked_folder/skin/frontend/default/templatename/js/ajaxsearch.js
(another trick is look in the first lines of ajaxsearch.js file, authors often write extension or theme names in it).
Long way:
Find where is this file included on page. Search for 'ajaxsearch.js' in xml files placed in app/design/frontend/default/templatename/layout/
if not found, try to search in app/design/frontend/default/default/layout/ etc.
For example you find it in somefile.xml
Try to find which extension include this file. For doing this search 'somefile.xml' in config.xml files in local and community pools:
app/code/local/some/extension1/etc/config.xml
app/code/local/some/extension2/etc/config.xml
app/code/community/some/extensionN/etc/config.xml
etc
If you found it in ...some/extensionX/etc/config.xml - this mean what ajaxsearch.js belongs to some_extensionX extension. If not found - it belongs to theme.

Magento template placement

I am developing a magento module that should inject some javascript at before_body_end. What I don't understand is where I should place my template file. In all tutorials, people suggest that they should be placed in app/design/frontend/default/default/{ModuleName}/{TemplateName}
First of all I can't get this to work. I get the error: Not valid template file:frontend/base/default/template/...
Furthermore, if I understand correctly, this would put the template in the default theme. But what if the end user uses another theme?
What does work, is placing the template file in app/design/frontend/base/default/{ModuleName}/{TemplateName}. However, I am not really sure if this is the way to go.
Can someone please tell me what the right course of action is here?
P.s. I need to modify the js based on conditionals. That's why I am not using addJs to inject the js.
Go to System -> Configuration -> Design -> Themes and check you fallback settings. You probably don't have "default" there.
First, Magento will look for the template, which is in the folder set in the "Templates" field in "Current package name" package , then if it doesn't exist, it will look for the template, which is set in "Default" field in "Current package name" package, and then it will look in the base/default folder.

Changing the content of a Joomla module on homepage

I have been asked to make a "one-off" change to the link on the homepage of a website that is running Joomla. The trouble is I am not familiar with Joomla administration. I was hoping it might be similar to WordPress, where I might have to modify a template file, however this does not seem to be the case.
Can anyone point me in the right direction on how to change the content of a module on the home page of a Joomla site? When I view the module settings in the Joomla admin there does not appear to be any content to edit, just menus and meta data. Thank you.
Every module has its own functionality so it depends on what module you are trying to modify.
You might want to look at template overrides. By doing a template override you can modify a module output without hacking the core code of the module.
So in the case of a module, you should look into your joomla installation for your module. If your module is called mod_stackoverflow for example, you should look for
PATH_TO_JOOMLA/modules/mod_stackoverflow/
Next you should look for the template file you want to modify. If you want to modify the default template of the module and if the output of your module can be overriden, you should look for the default.php file like so:
PATH_TO_JOOMLA/modules/mod_stackoverflow/tmpl/default.php
At this point you should copy the file into your template folder following this structure:
TEMPLATE_NAME/html/mod_stackoverflow/default.php
By placing this file in your template folder, Joomla will use this file (instead of the one in the module folder) to output the module content. Now you can edit this file as you like.
Hope this helps.
Check the homepage content is an article or module . If it was article you just go to the following path.
Joomla administrator->Contents->Featured Articles->
here you can find the home page article and modify it by click on article title.
If it was module you just go Joomla administrator-> Components->Module Manager
here you first find which module is enabled in homepage. Then you can edit the module contents.

Does a programmer's "document template" with tags exist for Windows?

I was wondering (if possible) if there was a program/tool/utility that when I create a new file and provide it with an extension that it creates the appropriate tags automatically?
For example, a new file I create called index.php would have the appropriate tags auto-generated inside:
<?php
?>
I hope you get the idea.
Any information regarding this would be helpful.
I don't know about a portable utility, but on Windows, there's a built-in feature that does it.
From regedit, go to your HKCR/.your-extension (e.g. HKCR/.php). the (Default) value will contain the filetype class - go to either HKCR/.your-extension/the-filetype-class or HKCR/the-filetype-class (either will do), then inside create a key named ShellNew. In the key, create a string value called FileName and assign to it the file path of your template file.
Now all new files with this particular extension will be created containing the contents of your template.
Here's a more detailed tutorial.
If you run Linux with GNOME, maybe http://tombuntu.com/index.php/2008/02/13/add-your-document-templates-to-gnome/ is what you need.
There is probably something similar in other environments.

Resources