?
avatar sandewt
sandewt
13 Feb 2018

Steps to reproduce the issue

This is not a real issue, but a proposal for a new feature.

Expected result

There is showing a warning on the Frondend site to enable JavaScript if desired. (optional)

Actual result

There is NOT showing a warning message if necessary.

System information (as much as possible)

Templates: Protostar and Beez3

Additional comments

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>	

See warning message image.
screen shot 2018-02-13 at 11 29 26

avatar sandewt sandewt - open - 13 Feb 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 Feb 2018
avatar dgt41
dgt41 - comment - 13 Feb 2018

Just copy paste from here:

<noscript>
<?php echo JText::_('JGLOBAL_WARNJAVASCRIPT'); ?>
</noscript>

avatar franz-wohlkoenig franz-wohlkoenig - change - 13 Feb 2018
Status New Discussion
avatar sandewt
sandewt - comment - 13 Feb 2018

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.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19665.
avatar dgt41
dgt41 - comment - 13 Feb 2018

then replace Administrator Backend with site

avatar sandewt
sandewt - comment - 13 Feb 2018

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."
avatar Bakual
Bakual - comment - 13 Feb 2018

Please use a slightly different key (eg JGLOBAL_WARNJAVASCRIPT_SITE) for the language string. That works better with translation tools and their memory.

avatar mbabker
mbabker - comment - 13 Feb 2018

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.

avatar brianteeman
brianteeman - comment - 13 Feb 2018

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

avatar brianteeman brianteeman - change - 13 Feb 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-02-13 19:04:12
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 13 Feb 2018

I am going to close this as it can't really be implemented in the core as its specifically template related

avatar brianteeman brianteeman - close - 13 Feb 2018
avatar sandewt
sandewt - comment - 17 Feb 2018

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.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19665.

Add a Comment

Login with GitHub to post a comment