Search

How do I add noscript element in the backend?

Just as you should do in a plain html file:

<noscript>
  Oh No, you either have JavaScript turned off or your browser doesn't support JavaScript
</noscript>

heheheh, this i know @plenaforma.

What do I need to know is in which Symphony backend file I can add the noscript element ;)

@tigo, You can place a <noscript> tag anywhere you need to define fallback content for users with JS disabled. It would all be in your regular .xsl template files so it just depends how you have them organised and where you need it. :) Just treat them like regular HTML though, so if you need one after a particular section or div then place one there.

@ijy I know but I need implement this in Symphony Backend. Not in a regular .xsl template.

Maybe in symphonylibtoolkitclass.frontendpage.php but i do not know how.

Are you attempting to place this no script on every backend page or just certain views? i.e. the Publish Section Entries view or somewhere else?

I wouldn't recommend editing the core code. If you want to inject something into the backend pages then your best bet would be to create a custom extension and use delegates to inject the <noscript> tag into the back-end pages on page generation. Which delegates you require depends on which pages you wish to inject into.

Let's go back a step.

Why would you like to add a noscript to the backend? Is it to alert potential authors that they must have Javascript enabled to use Symphony?

Maybe in symphonylibtoolkitclass.frontendpage.php but i do not know how.

This will not work because it's only responsible for generating frontend pages, not the backend.

@brendo Yes, I need to redirect the author if javascript is disabled.

@tigo, I have made an extension Symphony Noscript which does something like what you want. I did it using bits of code from my other extensions, so not too much effort.

The extension adds the following bit of HTML to the document head:

<noscript>
    <meta http-equiv="refresh" content="0;URL=http://www.example.com/symphony/noscript/"/>
</noscript>

The necessary 'noscript' content page is included. Fork!

@Petertron Thanks thanks thanks!! That's exactly what I needed. Again, thanks!! :)

That's exactly what I needed.

Good to know!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details