TinyMCE 4 - Apply format to paragraph tag

6 posts by 3 authors in: Forums > CMS Builder
Last Post: July 19, 2017   (RSS)

By Toledoh - July 17, 2017

Hey Gary.

I think it's got something to do with the wysiwyg-custom.php file: example below:

{title: 'Lead Paragraph', selector: 'p', classes: 'lead'},

Cheers,

Tim (toledoh.com.au)

Thank you for the reply - I should be able to click the "P" in the status bar and then select a class from the drop-down, but this is not working and the class is not being applied to the paragraph.  I will take a look at your solution and maybe I can contrive a way to make this work.

Thank you again!

Gary.

By Dave - July 18, 2017

Hi Gary, 

Can you attached your wysiwyg_custom.php file if you've made any changes?  

Dave Edis - Senior Developer
interactivetools.com

By garyhoffmann - July 19, 2017 - edited: July 19, 2017

Hi Dave,

It's a complex custom wysiwyg_custom.php that you will probably not be able to use out of the gate without making changes as you will not have the full infrastructure necessary.

I'll send it in it's full form, but you may have to make additional changes.

There may still be some test code in there because I've been trying all sorts of things.

Attachments:

wysiwyg_custom.php 10K

By garyhoffmann - July 19, 2017 - edited: July 19, 2017

I might have an answer to this one...it appears that you can only have a style that applies to a P tag (or any other specific block tag) and doesn't create a span around it if you hard-code define them in the style_formats array.  If I define the style there, it seems to work.  All other class styles appear to be forced to inline span instead of applying to the selector you have specifically highlighted in the statusbar.

I can work with this.  This is the primary one I need to apply to a specific selector and it's for making videos and maps responsive.

Needless to say, Toledoh was right on - I just didn't understand what needed to be done.

Thank you for any time you have spent on this.

Gary.