Results 1 to 4 of 4

Thread: Customisable tinyMCE editor for listings

  1. #1
    Expired Customer gonesmith's Avatar
    Join Date
    Jun 2012
    Posts
    764
    Thanks
    50
    Thanked 202 Times in 137 Posts

    Customisable tinyMCE editor for listings

    I just posted this in another thread but thought it would be worth having a separate "tutorial" thread since the other one was marked as "Solved".

    Anyway, I found a more customisable way to add a tinyMCE editor in the listing form than the method described in other threads/tutorials, you can use this (example);

    Import the form-listing.php file into your child theme. Around line 110 you will see this;
    PHP Code:
        <div class="form-field"><label>
            <?php _e'Business Description'APP_TD ); ?>
            <textarea name="post_content"><?php echo esc_textarea$listing->post_content ); ?></textarea>
        </label></div>
    Replace that code with this;
    PHP Code:
        <div class="listing-editor"><label>
            <?php _e'Business Description'APP_TD );?>
        </label></div>

    <?php
            $settings 
    = array(
            
    'textarea_name' => post_content,
            
    'wpautop' => true,
            
    'media_buttons' => false,
            
    'tinymce' => array(
                
    'theme_advanced_buttons1' => 'bold,italic,underline,blockquote,justifyleft,justifycenter,justifyright,justifyfull,forecolor,backcolor,removeformat',
                
    'theme_advanced_buttons2' => 'formatselect,bullist,numlist,outdent,indent,image,hr,link,unlink',
                
    'theme_advanced_buttons3' => '',
                
    'theme_advanced_buttons4' => '',
                
    'content_css' => get_stylesheet_directory_uri() . '/editor-styles.css'
            
    ),
            
    'quicktags' => false
            
    );

            
    wp_editor$listing->post_contentlistingeditor$settings); ?>
    You can choose which buttons are available for users (a full list is here; http://www.tinymce.com/wiki.php/Tiny...ttons/controls) and you can choose in what order they appear. If you want to enable the text editor also, use 'quicktags' => true. You're meant to be able to select which quicktags show like this 'quicktags' => array('buttons' => 'b,i,u') also but I couldn't get that working. When I did that it just showed none.

    You can then create an editor style by creating a CSS file called editor-styles.css, adding whatever styles you need, and then adding this to your child theme's function.php;
    Code:
    /* ==========  Add styles to the WYSIWYG editor ========== */
    
    add_editor_style('editor-styles.css');
    One word of caution. If you decide to use a tinyMCE editor in the listing form be prepared to have users simply copy and paste from their website and then be confused as to why it doesn't look right when they save it, not realising that they have copied and pasted all the html mark up.

  2. The Following User Says Thank You to gonesmith For This Useful Post:

    danyz (July 27th, 2013)

  3. #2
    Veteran enrique_traun's Avatar
    Join Date
    Feb 2012
    Location
    Austria
    Posts
    439
    Thanks
    68
    Thanked 17 Times in 17 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #3
    Expired Customer gonesmith's Avatar
    Join Date
    Jun 2012
    Posts
    764
    Thanks
    50
    Thanked 202 Times in 137 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. The Following User Says Thank You to gonesmith For This Useful Post:

    enrique_traun (July 28th, 2013)

  6. #4
    Veteran enrique_traun's Avatar
    Join Date
    Feb 2012
    Location
    Austria
    Posts
    439
    Thanks
    68
    Thanked 17 Times in 17 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] tinymce editor in listings not working
    By tbase in forum Report Vantage Bugs (Legacy)
    Replies: 5
    Last Post: February 26th, 2013, 08:58 PM
  2. Insert Image button tinyMCE editor
    By mikel in forum Clipper General Discussion
    Replies: 3
    Last Post: September 19th, 2012, 03:17 PM
  3. There is a problem in TinyMCE editor, see this image:
    By lars in forum ClassiPress General Discussion
    Replies: 5
    Last Post: November 14th, 2011, 04:24 AM
  4. TinyMCE Editor Font Color Default
    By epijunky in forum Help Using ClassiPress
    Replies: 6
    Last Post: May 29th, 2010, 09:59 AM