WordPress.org

Ready to get started?Download WordPress

Forums

Multiple content blocks
[resolved] Editor tabs (Wysiwyg and HTML) broken (18 posts)

  1. onetrev
    Member
    Posted 2 years ago #

    After updating to WP 3.3, the tabs for switching between HTML and WYSIWYG editor are broken. Looks like otherwise the plugin continues to work as normal though.

    http://wordpress.org/extend/plugins/multiple-content-blocks/

  2. jwheck
    Member
    Posted 2 years ago #

    Same here. I can switch between WYSIWYG and HTML on the main content block, but not the added block - just HTML.

  3. raskull
    Member
    Posted 2 years ago #

    For me, the tabs are broken (they don't toggle), the tinymce buttons are missing, and content entered does not show up on the front end. (Pre-3.3 entered content continues to display on the front end.)

  4. Under_Dog
    Member
    Posted 2 years ago #

    I have a solution for this issue which seems to be working so far.

    Edit the plugin and find this section:

    echo '<textarea id="multiplecontent_box-'.$fieldName.'" tabindex="2" name="multiplecontent_box-'.$fieldName.'" cols="158" class="theEditor" rows="15">';
    			$content = get_post_meta($post->ID, '_ot_multiplecontent_box-'.$fieldName , true);
    			echo apply_filters('the_editor_content', $content);
    		echo '</textarea>';

    Replace it with the following:

    wp_editor( get_post_meta($post->ID, '_ot_multiplecontent_box-'.$fieldName , true), 'multiplecontent_box-'.$fieldName, $settings = array() );

    Just about that you'll also see this:

    echo '<a id="edButtonHTML" class="hide-if-no-js" onclick="switchEditors.go(\'multiplecontent_box-'.$fieldName.'\', \'html\');">HTML</a><a id="edButtonPreview" class="active hide-if-no-js" onclick="switchEditors.go(\'multiplecontent_box-'.$fieldName.'\', \'tinymce\');">Wysiwyg</a>';

    Just comment it out like so:

    //echo '<a id="edButtonHTML" class="hide-if-no-js" onclick="switchEditors.go(\'multiplecontent_box-'.$fieldName.'\', \'html\');">HTML</a><a id="edButtonPreview" class="active hide-if-no-js" onclick="switchEditors.go(\'multiplecontent_box-'.$fieldName.'\', \'tinymce\');">Wysiwyg</a>';

    This replaces the old style editor with the new editor they've introduced in the new version. Again, I haven't fully tested this implementation yet, but it seems to work for me so far :)

  5. jwheck
    Member
    Posted 2 years ago #

    That works great! Thanks, Under_Dog!

  6. raskull
    Member
    Posted 2 years ago #

    That fixed the editor for me, however I still cannot publish new content or edit previous content and have it show on the front end.

  7. ReneODeay
    Member
    Posted 2 years ago #

    try the "Use Google Libraries' plugin. made the tabs on editor work again for me.

  8. hanheg
    Member
    Posted 2 years ago #

    Thanks Under_Dog.... your solution works like treat!

  9. Trendwerk
    Member
    Plugin Author

    Posted 2 years ago #

    I've just updated the plugin with this solution, thanks Under_Dog!

  10. raskull
    Member
    Posted 2 years ago #

    Thanks so much, Ontwerp. I discovered the cause of my problem with publishing and editing (which I coincidentally introduced around the time of the upgrade). Due to your lines 120 and 122, my line formatted as
    get_the_block( 'myblock' )
    was causing the problem. I removed the spaces so it reads
    get_the_block('myblock')
    and now everything works fine. Would you consider modifying those lines so they are not dependent on ones code formatting style?

  11. Trendwerk
    Member
    Plugin Author

    Posted 2 years ago #

    Done as well.

    It's quite hard to interpret everybody's coding style perfectly, but I also believe this was one that we should support.

    Sadly, it's not possible to make them independant from one's coding style, because I have to read and interpret the code in the template file.

    It baffles me that there's still no support for additional content blocks in WP3.3, but this seems to be the only (plug-and-play) option.

  12. onetrev
    Member
    Posted 2 years ago #

    Thanks for fixing this! And yes I totally agree, it is mind boggling with all the CMS advancements WP has made that there is no built in support for multiple content blocks.

    There is discussion on content blocks here: (http://wordpress.org/extend/ideas/topic/multiple-content-blocks) with people asking for it to be brought into WP, but amazingly it seems some core developers don't think it is needed. Maybe if more folks can ask for content block support it will cause the core developers to re-think it.

  13. raskull
    Member
    Posted 2 years ago #

    Thanks a million! I agree this needs to be core functionality. I'll chime in on the discussion over there later. But in brief, I think that people who don't think it should be core are people who don't understand how we're using this -- cms style.

    Part of the confusion is terminology. It took me a very long time to find this plugin, because I was googling "different sidebar per page" and things like that. Which led to solutions using conditional sidbars, conditional widgets, etc. That doesn't work for a site with 200 pages.

    Further complicating matters is WordPress's use of "sidebar" to mean any area that is widget ready, whether it's on the side or not.

    Hopefully, HTML5's "aside" element will help developers understand The Nature of Content, while they work on an easy way for us to put our page-specific asides in, say, ... the bar on the side...

  14. mrbryan
    Member
    Posted 1 year ago #

    THis is still broken for me on latest wordpress, -- I also have qTranslate installed in case that's relevant.

    I looked at the code and see that the patch above is applied.

    The switch between html and visual doesn't work on the individual blocks, but if i switch to HTML/VISUAL on the normal editor boxes (not multiple blocks ones) then update the page, ALL the editors will switch to html/visual at once (including multiple block)

  15. mrbryan
    Member
    Posted 1 year ago #

    Here's some debug:

    Uncaught TypeError: Cannot read property 'value' of null post.php:578
    switchEditors.go post.php:578
    switchEditors.switchto load-scripts.php:408
    onclick post.php:1066

  16. mrbryan
    Member
    Posted 1 year ago #

    Looking at the code it appears to be qTranslate that replaces the language switch function but does not give the multiple languages functionality at the same time.

    If someone has an idea about how to make the two work together that would be amazing

  17. Trendwerk
    Member
    Plugin Author

    Posted 1 year ago #

    This problem should be fixed in the new completely rewritten 3.0. Templates and annotations should always work now.

    Any suggestions or issues? Please tell us on Git!
    https://github.com/trendwerk/multiple-content-blocks/

  18. Trendwerk
    Member
    Plugin Author

    Posted 1 year ago #

    Marking this as resolved.

    Still having issues? https://github.com/trendwerk/multiple-content-blocks/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic