This is not a real issue, but a proposal for a new feature.
There is showing a warning on the Frondend site to enable JavaScript if desired. (optional)
There is NOT showing a warning message if necessary.
Templates: Protostar and Beez3
For many sites it is necessary to turn on JavaScript.
So it seems convenient to add this functionality as an extra option in the template settings.
Default = no.
Example code change in the index.php from Protostar:
<!-- Body -->
<div class="body" id="top">
<noscript>
<?php echo JText::_('TPL_PROTOSTAR_WARNJAVASCRIPT'); ?>
</noscript>
Status | New | ⇒ | Discussion |
Just copy paste from here:
@dgt41 that was also my first thought, but the text of the Constante is related to the backend and not to the frontend.
See the \administrator\language\en-GB\en-GB.ini.
JGLOBAL_WARNJAVASCRIPT="Warning! JavaScript must be enabled for proper operation of the Administrator Backend."
I do not know if it is in Joomla! desirable to hang different text on the same Constant?
It is useful to use the same constant for Protostar and Beez3.
then replace Administrator Backend
with site
then replace Administrator Backend with site
Is it allowed to use the same constante twice @dgt41 ? So yes...
I closer look let's see that this as expected works for both templates.
By adding the folowing code in the file joomla\language\en-GB\en-GB.ini.
JGLOBAL_WARNJAVASCRIPT="Warning! JavaScript must be enabled for proper operation of the Frontend site."
Please use a slightly different key (eg JGLOBAL_WARNJAVASCRIPT_SITE) for the language string. That works better with translation tools and their memory.
While it's easy to do for the core templates, a part of me wonders if there is actually going to be any benefit here as most sites aren't using the core templates and wouldn't have this option/feature available. You'd almost be better off making a mod_custom
instance with the <noscript>
tag than hardcoding something into the template markup.
And there are even less users who browse with javascript disabled
2016 stat of 0.2% https://blockmetry.com/blog/javascript-disabled
In other words this isnt something we need to add to the core
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-02-13 19:04:12 |
Closed_By | ⇒ | brianteeman |
I am going to close this as it can't really be implemented in the core as its specifically template related
Thank you all for the info and the thinking.
So I have searched for an alternative and came out on a simple plugin, based on the following principle.
(For the enthusiast.)
CODE PLUGIN
public function onAfterRender()
{
<!-- some code -->
$body = $this->app->getBody();
$body = str_replace('</body>', $message . '</body>', $body);
$this->app->setBody($body);
}
And so on.
Just copy paste from here:
joomla-cms/administrator/templates/isis/login.php
Lines 124 to 126 in 8d7a917