Custom Content Block Typography.CSS - Package

Permalink
Hello,

Is there a way to link to a typography.css file for a custom content block?

I'm creating a custom content block that different users/groups work with and it contains different buttons available than the "advanced" or "office" versions of the site's default content block. It's in a package, which shouldn't make a difference I would think.

I can't get the custom content block to pick up any kind of typography.css when editing/adding. After updates, the text is correctly styled from the theme but not while editing/adding. It also lacks text styles that you would have with a typography.css file.

Thanks in advance!

 
JWare replied on at Permalink Best Answer Reply
I've managed to figure it out but in block form (not a package due to strange errors), so here's the steps in how I did it as a block. It is by no means perfect and probably isn't the ideal solution. Be aware that these steps are for a pre-existing custom content editor block and is not a guide for making the custom block, but making the custom block read the typography.css of a theme.

Under
\concrete\blocks\content
Copy editor_config.php and paste it in the following directory
\blocks\YOUR BLOCKS NAME\elements

Open the editor_config file and locate line 19, which should read as:
content_css : "<?php echo $theme->getThemeEditorCSS()?>",


Change this to:
content_css : "../../themes/YOUR THEME NAME/typography.css",


Now go back to the main folder for your block.
Open the form_setup_html.php file,

The default code for one line may read like this as it did for mine:
Loader::element('editor_config');


Rewrite it as the following:
Loader::element('../blocks/YOUR BLOCKS NAME/elements/editor_config');


The editor should now find and use the typography.css file of your theme while also having the ability to change what buttons are available for users/groups in the editor_config file.

I know it's not a perfect solution, but it worked for me.