Landing Pages Now Adding Unwanted Styles

Until version 2.0 I had lots of lovely landing pages that worked beautifully. Now Mautic has started adding it’s own in-line styles which is completely messing up the look and feel. So, for example, it has added the following to an element:



style="-webkit-user-select: auto;"



I appreciate that some might want to use the wysiwyg editor to create their landing pages but I am happy crafting my own html.



How can I stop Mautic “helping” by adding it’s own styles?



I am using the blank theme.



Thanks

Until version 2.0 I had lots of lovely landing pages that worked beautifully. Now Mautic has started adding it’s own in-line styles which is completely messing up the look and feel. So, for example, it has added the following to an element:

 style="-webkit-user-select: auto;"

I appreciate that some might want to use the wysiwyg editor to create their landing pages but I am happy crafting my own html.

How can I stop Mautic “helping” by adding it’s own styles?

I am using the blank theme.

Thanks

Hi,

many of us are experiencing the same. There is a long conversation 2 of us had with escopecz on Slack as well as a couple of forum posts here Editor Timeouts

It is very frustrating however the Froala editor does not seem to play with Twig at all and is stripping many headers from perfectly good pages and email templates. For some reason a link to font-awesome cdn is being added also.

A raw HTML option or bypass the editor would be a great feature as Froala is not good…

Ah ok, thanks for the clarification. So I guess I have to sit back and wait for an update? However, giving that the upgrade from 2.0 to 2.1 doesn’t work for me not sure what I should do. Beginning to think Mautic isn’t going to be suitable for us.

This is a major issue for us too. Is there a fix in the works or feature request? A practical temp solution would be update the custom_html in the database directly. This only solves it if your pages are static though, ours need to be updated through the front-end.

I now have a workaround for this issue, updating the pages directly in db. It’s working nicely so far, let me know if interested, I’ll share it.

Hi @balkee, I’m happy to update via the db so if you have instructions that would be great. Thanks

Hi

Just to let you know I find the column in the pages table so have been able to make the changes there. Not really ideal but it will do for now.

Thanks

if you’re updating, here’s my 1-line solution using load_file method:

update pages set custom_html=load_file('landingpage.html') where id={your-page-id};

If you’re inserting new pages, using the same method:

insert into pages(title,alias,template,content,lang,hits,unique_hits,variant_hits,is_published,revision,custom_html)
values ('mypage','mypage','blank','a:0:{}','en',0,0,0,0,1,load_file('landingpage.html') );

Test it in your test environment to make sure the pages work as intended in Mautic. This allows you to maintain your html files and load when there are changes… I actually have stored procedures and a shell script that handles multiple files, but in essence above sql is the main solution. Load_file function makes it very easy to load directly from html files, no need to handle escape sequences, copy paste, etc…

*Note on load_file function in mysql: First, run the command in mysql: > select load_file(‘landingpage.html’);
to make sure the function is returning the html. Default location mysql looks for files is “datadir”, remember mysql will not be pointing at your local folders, C:, etc… you’ll need to copy your files to the server.