Skip to:
Content
Pages
Categories
Search
Top
Bottom

visual editor showing html in posts


  • Momshof
    Participant

    @momshof

    Hello – As a normal user (not admin) the posts are showing the html (I think that is what it is called). For example – it looks like this when posted:

    <p style=”text-align: center;”>Creating a test topic 1.</p>
    <p style=”text-align: center;”>Creating a test topic 1.</p>
    <p style=”text-align: right;”>Creating a test topic 1.</p>
    <p style=”text-align: right;”>Creating a test topic 1.</p>
    <span style=”font-family: Impact,Charcoal,sans-serif;”>Creating a test topic 1.</span>

    <span style=”font-family: Impact,Charcoal,sans-serif;”>Creating a test topic 1.</span>

    <span style=”font-size: 18pt;”>Creating a test topic 1.</span>

    <span style=”font-size: 18pt;”>Creating a test topic 1.</span>

    <span style=”text-decoration: underline;”>Creating a test topic 1.</span>

    <span style=”text-decoration: underline;”>Creating a test topic 1.</span>

    <span style=”color: #339966;”>Creating a test topic 1.</span>

    <span style=”color: #339966;”>Creating a test topic 1.</span>

    <span style=”background-color: #000000; color: #00ff00;”>Creating a test topic 1.</span>

    <span style=”background-color: #000000; color: #00ff00;”>Creating a test topic 1.</span>

    I am using GD bbPress Toolbox to have more options on my visual editor.

    Also – is there any way to completely REMOVE the “text” tab option (only have visual editor available)?

    Thanks for your assistance.

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

  • Momshof
    Participant

    @momshof

    Update – I found this code searching through the forums and tried it – it fixed the quotes – they are no longer showing raw code.

    The font, size, color, align – still comes up as raw code.

    function bbp_tinymce_paste_plain_text( $plugins = array() ) {
    $plugins[] = ‘paste’;
    return $plugins;
    }
    add_filter( ‘bbp_get_tiny_mce_plugins’, ‘bbp_tinymce_paste_plain_text’ );

    last post on – http://dtcdancecentral.com/DTCTest/forums/topic/creating-a-topic-1-test-2/#post-12237


    Momshof
    Participant

    @momshof

    Anyone know of a solution?


    Robkk
    Moderator

    @robkk

    Common thing to see if you activated tinymce for bbPress. Some of the html tags bbPress restricts usage from regular participants could also be used for Tinymce. Customize this function to your liking if there are many more html tags not outputting.

    add_filter( 'bbp_kses_allowed_tags', 'ntwb_bbpress_custom_kses_allowed_tags' );
    function ntwb_bbpress_custom_kses_allowed_tags() {
    	return array(
    		// Links
    		'a'          => array(
    			'class'    => true,
    			'href'     => true,
    			'title'    => true,
    			'rel'      => true,
    			'class'    => true,
    			'target'    => true,
    		),
    		// Quotes
    		'blockquote' => array(
    			'cite'     => true,
    		),
    		
    		// Div
    		'div' => array(
    			'class'     => true,
    		),
    		
    		// Span
    		'span'             => array(
    			'class'     => true,
                            'style'     => true,
    		),
    		
                    // Paragraph
    		'p'             => array(
    			'class'     => true,
                            'style'     => true,
    		),
    
    		// Code
    		'code'       => array(),
    		'pre'        => array(
    			'class'  => true,
    		),
    		// Formatting
    		'em'         => array(),
    		'strong'     => array(),
    		'del'        => array(
    			'datetime' => true,
    		),
    		// Lists
    		'ul'         => array(),
    		'ol'         => array(
    			'start'    => true,
    		),
    		'li'         => array(),
    		// Images
    		'img'        => array(
    			'class'    => true,
    			'src'      => true,
    			'border'   => true,
    			'alt'      => true,
    			'height'   => true,
    			'width'    => true,
    		),
    		// Tables
    		'table'      => array(
    			'align'    => true,
    			'bgcolor'  => true,
    			'border'   => true,
    		),
    		'tbody'      => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'td'         => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'tfoot'      => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'th'         => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'thead'      => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'tr'         => array(
    			'align'    => true,
    			'valign'   => true,
    		)
    	);
    }

    You may not need to completely turn off the html editor tab now, as it is quite useful for users.


    Momshof
    Participant

    @momshof

    Thank you – I am not sure where to put the above or which ones to use.

    The only buttons I have that are not working properly for users are:

    align left
    align center
    align right
    font family
    font size
    underline
    text color
    background color (for text)

    The rest are working ok.

    Thanks!


    Robkk
    Moderator

    @robkk

    I am not sure where to put the above or which ones to use.

    Place the php code snippet into your child themes functions.php file or place the snippet in a plugin like functionality.


    Momshof
    Participant

    @momshof

    Hey – I entered the code above in my child theme functions php file and my site went white. No pages would come up – all just white.

    In chrome it said 500 error – in firefox just white screen. Any ideas?


    Momshof
    Participant

    @momshof

    Any ideas why this happens? Still can not get the

    align left
    align center
    align right
    font family
    font size
    underline
    text color
    background color (for text)

    to work for front end users.

    I tried Tiny MCE Advanced and it caused alot of issues – half of an individual post showed up in my black background – half in the “white” text area – still did not allow proper showing of the above formatting (showed code when published) – really a mess so I went back to WP Edit.

    Also – all buttons are working fine in my other areas (like Sabai directory) for front end users – just BBPress?


    Robkk
    Moderator

    @robkk

    I just tested out the code and it seems to work fine. Make sure that you copied over the whole bit of code and did not miss anything. I put the code on a gist file so maybe it will be easier to copy over.

    https://gist.github.com/robkk/b24443ad53ece6d2b7c9

    I tried Tiny MCE Advanced and it caused alot of issues – half of an individual post showed up in my black background – half in the “white” text area

    Maybe this is a CSS issue?? Not sure really.

    still did not allow proper showing of the above formatting (showed code when published)

    The code fixes it whenever you make a new post, it might not work for existing posts that have not parsed everything, it might need to be republished on the old posts.

    really a mess so I went back to WP Edit

    I have come across an issue that was present using WP Edit.

    Also – all buttons are working fine in my other areas (like Sabai directory) for front end users – just BBPress?

    bbPress tries to be secure for frontend posting for users, so that they do not post harmful javascript. It might be a little too secure.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar