Jump to content

Prevent FormBuilderMultiplier to inject script tags in my MJML export


joe_g
 Share

Recommended Posts

Hi there,

So I used the plugin FormBuilderMultiplier by @BitPoet. The module has been working great but I run into an issue:

It injects the line <script type="text/javascript" src="/godzillab-stripe/site/modules/FormBuilderMultiplier/FormBuilderMultiplier.js"></script></head>

..on every page. That means it also appears inside my MJML export and breaks the MJML.

In the PageMjmlToHtml i made sure to not include anything automatically, but it gets included anyway. Not sure if mr BitPoet is around, if not, then I'm wondering what the workaround (if any) might be?

many thanks,

J

Link to comment
Share on other sites

Yes, Mr. BitPoet is around ? Glad to hear you like my module. As a quick & dirty workaround, you could insert a short check for your PageMjmlToHtml template/page in the addScripts function in FormBuilderMultiplier.module after $page is assigned:

// If you want to prevent inclusion of the script for all pages with a certain template
if($page->template->name === "PageMjmlToHmtl") return;
// Or for a certain page id
if($page->id === 19389) return;

It makes sense to avoid including the script in every page that is rendered. I'm going to add a more selective mechanism there.

Link to comment
Share on other sites

3 hours ago, joe_g said:

In the PageMjmlToHtml i made sure to not include anything automatically, but it gets included anyway. Not sure if mr BitPoet is around, if not, then I'm wondering what the workaround (if any) might be?

I'm assuming that PageMjmlToHml is a template, right? In that case, you can try the latest dev release 0.0.11. It has an option to exclude certain templates from script tag injection in the module settings.

fbm_excludetemplates.png.a019eadfb94d70fdcfbfb9dbe2dd7eae.png

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...