Compatibility & Other Settings

Follow

metro-publisher-compatibility-features-2024.png

 

With each new release of Metro Publisher, our development team introduces new features and adjustments to code. In some cases we allow users to opt-in to the new features. In other cases, changes in code may cause conflicts with some older clients who may be using certain features that are being phased out. We add those as Beta Features in order to avoid compatibility issues with older features. 

To get to the Beta Features tab for your website:

  • Log in as an Admin
  • Go to Settings > Other

Below is a list of our current additional and backwards compatibility features

New Features

These offer improvements to current features, but clients may want to update these at a time that is convenient for them.

  • Use new overviews (refers to the newest version of content / location / event overview tables)
  • Enable Progressive Web App (requires additional settings as outlined here: Progressive Web App (PWA)

Compatibility Features

For most clients, these features should be ON, with the exception of the "Hide Sprocket Headline Image" option. This latter option is a personal choice and will not influence code performance.

  • Clean HTML
  • Hide require, requirejs and define functions which could cause external JavaScript to error (see note below)
  • Hide the topad2 div if you use responsive ads
  • Load some Sprockets via AJAX where appropriate
  • Hide deprecated Facebook options
  • Don't load requirejs and only load jquery on pages that need it (relevant to performance)
  • Hide Sprocket Headline Image
  • Hide the deprecated sections button (refers to our newest Layout Section Editor)
  • Escape non-ASCII characters in global JavaScript variable

 

requirejs

At Metro Publisher, we use requirejs to load other JavaScript modules. We also set it and JQuery to private variables so as not to pollute the global namespace and cause conflicts. This website explains requirejs in detail: https://requirejs.org

NOTE: If you aren't familiar with requirejs, the rule of thumb is that you do not need it and should keep that box unchecked.

Unchecking the "Hide require, requirejs and define functions which could cause external JavaScript to error" box will expose it:

<script tal:condition="expose_require">
require = _mp_require;
requirejs = _mp_requirejs;
define = _mp_define;
</script>

Activating this option will make it not load requirejs at all:

def require_jquery(request, main_js, config):
if 'baseUrl' not in config:
config['baseUrl'] = request.static_url('vanguardistas.publicview:static/')
new_features = option.get_option(request.db, 'new_features')
if new_features.dont_load_requirejs:
return ''
values = dict(
expose_require=not new_features.hide_requirejs,
js=main_js,
require=json_for_script(config))
return _render('templates/require_jquery.pt', values, request)

In other words hide = private variables to not pollute namespace, therefore, "hide" should always be checked unless you want to use it or other code needs it.

 

Load some Sprockets via AJAX where appropriate

AJAX is a combination of web and programming technologies for data exchange with servers that essentially makes applications faster and more responsive since it is a more efficient exchange method.

 

Don't load requirejs and only load jquery on pages that need it

Ticking this checkbox will keep JavaScript/JQuery from loading on all pages and restrict it to loading only on the pages that need it to function. This will speed up loading of individual pages that don't need to run those scripts to display the content or offer the features designated for that page.

 

Escaping non-ASCII characters

Characters outside of the basic English alphabet, e.g. symbols, accented letters, and characters from different languages are called non-ASCII characters. When converting text from a non-ASCII character set to ASCII issues with the text display might crop up. This setting helps encode (convert) such character sets correctly.

Have more questions? Submit a request

Comments

Powered by Zendesk