joe_g Posted October 18, 2023 Share Posted October 18, 2023 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 More sharing options...
BitPoet Posted October 18, 2023 Share Posted October 18, 2023 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 More sharing options...
BitPoet Posted October 18, 2023 Share Posted October 18, 2023 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. Link to comment Share on other sites More sharing options...
joe_g Posted October 21, 2023 Author Share Posted October 21, 2023 Ha, fantastic! Thank you! I'll try this one of the coming days Link to comment Share on other sites More sharing options...
joe_g Posted November 15, 2023 Author Share Posted November 15, 2023 Tried it now and it works beautifully! Thank you for this update!! Link to comment Share on other sites More sharing options...
BitPoet Posted November 15, 2023 Share Posted November 15, 2023 8 hours ago, joe_g said: Tried it now and it works beautifully! Thank you for this update!! Glad to hear, thanks for the feedback! I have pushed the change to the main branch. Link to comment Share on other sites More sharing options...
monollonom Posted November 16, 2023 Share Posted November 16, 2023 Hey! PageMjmlToHtml author here ? @BitPoet wouldn't it be best if instead of having to opt-out templates the js script was only added when the multiplier fields are added? Not tested but maybe you could put the Page::render hook inside of addMultipliedFieldsToProcessor? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now