voidlabs / mosaico

Mosaico - Responsive Email Template Editor
https://mosaico.io
GNU General Public License v3.0
1.69k stars 500 forks source link

Allow using/editing pre-header text without showing the pre-header block. #582

Closed homotechsual closed 4 years ago

homotechsual commented 4 years ago

It would be good to show the pre-header text and control that without needing to show/use the pre-header block with the unsubscribe links etc.

bago commented 4 years ago

Mosaico doens't define anything in this regard. It's all about the template. Versafix-1 works that way, but it should pretty easy to create a different master template so to change the behaviour.

homotechsual commented 4 years ago

So as far as I can tell Mosaico will only allow editing a block that is visible?

bago commented 4 years ago

Mosaico will only let you edit something that will have an impact on the output. Editing a block that is not there would not change the HTML. The preheader block is not there if you don't enable it.

bago commented 4 years ago

BTW if you put something like this in the main body, (so you move this out of preheaderBlock if you use versafix-template) then your preheaderText will be always present in the email and its editor will always be shown in the Content sidebar:

      <div style="display: none; font-size:1px; line-height: 1px; max-height:0px; max-width: 0px; opacity: 0; overflow: hidden; 
          -ko-bind-text: @preheaderText"></div>