Jump to content

Text Formatters?


pers0n
 Share

Recommended Posts

I've been trying to have process wire strip the classes from P tags and when I paste in code, its not doing it.

Can you post in your code and how you have tried to achieve that? You are building custom textformatter and use it with tinyMCE fields?

Link to comment
Share on other sites

I'm using the default setup in Processwire and only modified this a bit. I finally got it to remove the classes from P tags, but pasting in from Word is giving me double P tags for everything, but if I paste from a plain text it removes all my line breaks, so I cant win.

Here are my settings

theme_advanced_buttons1

formatselect,|,bold,italic,|,bullist,numlist,|,link,unlink,|,image,|,code,|,fullscreen

theme_advanced_buttons2

BLANK

theme_advanced_blockformats

p,h2,h3,h4,blockquote,pre

plugins

inlinepopups,safari,media,paste,fullscreen

valid_elements

@[id],a[href|target|name],strong/b,em/i,br,img[src|id|class|width|height|alt],ul,ol,li,p,h2,h3,h4,blockquote,-p,-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],code,pre

Link to comment
Share on other sites

Ah, so you are just playing with tinyMCE settings. I am not pro with that magic, but I would try this:

Default stuff:

@[id|class],a[href|target|name],strong/b,em/i,br,img[src|id|class|width|height|alt],ul,ol,li,p[class],h2,h3,h4,blockquote,-p,-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],code,pre

I would try to remove that bold thing there and not touch anything else. It should make this:

<p class="SomeUglyMsWordClasses">Text here</p>

into this:

<p>Text here</p>
Link to comment
Share on other sites

  • 2 years later...

I would like to know what each of the Text Formatters do as well. Since only half of the OP's question was answered, can someone explain each one and what it's best used for / when? Would be super helpful for beginners not familiar. 

:)

Link to comment
Share on other sites

Don't they say what they do if you go to the modules page on your installion and click on them?

Can't check myself as I'm on my phone but I would have thought they'd have a description of what each does there.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...