• Resolved rochow

    (@rochow)


    A few years ago we made a number of custom blocks.

    The header block had <style type=”text/css”> which also includes media queries. All basic stuff.

    I assume something has changed with inline rendering as now it’s outputting this CSS instead of rendering.

    I looked into themes but they are old 1 window WYSIWYG.

    What is the simplest way to have CSS in the “head” of the ‘template’ being used by the block editor? Very standard to include especially in conjunction with the CSS inline which has limitations due to the complexity, and doesn’t support media queries.

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Stefano Lissa

    (@satollo)

    Hi, if you create a custom block, add to its folder a file named “style.css” and it will be included in the head of the generated email. On latest versions you can even add a “global” CSS, see the Settings subpage on the Newsletters admin section.

    Thread Starter rochow

    (@rochow)

    Ah thanks, I looked under Settings but didn’t realise Newsletter -> Settings had more settings. Thanks!

    It would be great to have a filter or textarea for the head section to add format-detection = no and such. Business number in the footer is auto-linked like a phone number so usually turn that off as any header/footer phone numbers we have coded the link.

    Plugin Author Stefano Lissa

    (@satollo)

    Hi, the header already has a few format-detection rules, but I don’t know how many email clients respect them (or if we need to add more rules).

    If you send yourself a a test newsletter to a gmail account, you can see the full source: could you help us to find out if those rules need to be extended?

    Thank you!

    Thread Starter rochow

    (@rochow)

    More-so if there was do_action() like WooCommerce for inserting HTML into header, footer kinda thing that would be awesome for devs to add whatever over time. Blocks are amazing for the content side, being able to modify the ‘wrapper’ a bit more would cover everything.

    Thanks Stefano!

    Plugin Author Stefano Lissa

    (@satollo)

    Hi, the email is stored as a full HTML and processed for each subscriber to add thre subscriber’s data. But we have the newsletter_message filter where you can modify the body of the email, for example adding new headers. For example you can replace “<head>” with “<head><something else>” and the result is to prepend something to the <head> content.

    See here for more filters: https://www.thenewsletterplugin.com/documentation/developers/dev-newsletter-hooks/

    Thread Starter rochow

    (@rochow)

    Ah cool so can string_replace = </head> with something else, perfect!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Blocks’ is closed to new replies.