Problem/Motivation

You should be able to include custom script type attributes, e.g. "application/json" or "text/x-handlebars-template".

Proposed resolution

Only unset the script type attribute if it is "text/javascript".

Comments

jtwalters created an issue. See original summary.

jtwalters’s picture

Status: Needs work » Needs review
StatusFileSize
new1022 bytes

Here's a patch.

jtwalters’s picture

StatusFileSize
new1.05 KB

Adding an isset check for avoiding PHP notices.

steinmb’s picture

This is allow us to use the #attribute instead of resorting to drupa_add_js()? Sorry, I'm not a js developer.

jtwalters’s picture

This patch simply allows you to use a custom type attribute on a script tag/element. It doesn't matter how you add the script tag. Omega is being too opinionated about removing the type attribute.

BarisW’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

This also enabled Omega themes to use the application/ld+json type.

tbenice’s picture

Just endorsing getting this in a release. I have to do some hackity stuff to make this work for google social profiles (ld+json).

Thanks!

damienmckenna’s picture