vizthink
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: wysiwyg editor reformatting my HTMLSoulplayer,
Sadly, I have no input on your issues with the Advanced TinyMCE buttons – although keep searching, I have seen some thingss floating in these forums that may pertain to your particular issue.
chrisbirchall,
Awesome! Glad its working and solved your problems (at least for the short term). Your initial guess was right, so you can continue to call me a Gentleman ??
Cheers!
Forum: Fixing WordPress
In reply to: wysiwyg editor reformatting my HTMLHey all,
I recently came across this thread in search of a solution for symptoms that most closely resemble planetim’s post.
iridiax – while I agree with and often practice what you preach, the content on our blog is occasionally authored by multiple people. So, not everyone in our group has the desire or experience to use straight HTML. In this scenario and under certain circumstances, straight HTML code added by one person may ‘vanish’ as a result of another author merely fixing a typo through the tinyMCE editor.
Up until now, this has not been a real problem with the one exception of iframes (a common solution for adding custom/ external content that I’m sure most folks here are familiar with).
Well, we recently stepped up to WordPress 2.5.1 and have been running smoothly until a need arose to post something with an iframe that would wrap some media content.
In short, what used to work in sub 2.5 WordPress would no longer be displayed correctly once an HTML post was revised with the tinyMCE editor .
Considering this a step back, I dug in and found a fairly forceful solution that meets our needs. Still, I felt it was relevant enough to share with the other folks out there who may have experienced the same frustrations I did.
Let me be clear – I am VERY aware that this is not the proper way to accomplish my goal. In fact, I encourage a more experienced user to enlighten us all with an approach that is easier to apply and has less potential for adverse effects.
And of course – as I just stated, the procedure below changes the intended function of the tinyMCE editor in WordPress and could cause irreversible damage to your blog. Therefore, consider the following for informational / discussion purposes only and proceed at your own risk:
- Locate the file ‘tiny_mce_config.php’ ( it should live in %your_blog_root%/wp-includes/js/tinymce/ )
- Assuming you want to avoid catastrophe if things go awry, back this file up!
- Open this file in any text editor and locate the following code ( Line 298 for me )
- Replace with this ( or a variation to suit your own needs )
- Save the file back to its original location
- Clear your browser cache ( for good measure )
- While technically unnecessary, you can also delete or rename the folder ‘js_cache’ ( it should live in %your_blog_root%/wp-content/uploads/ )
- Test your new settings with the desired code by toggling back and forth between the ‘Visual’ and ‘HTML’ tabs at least once. Return back to the HTML view to verify the code is still there and finally back to the ‘Visual’ tab to save/publish a test post.
// Add external plugins and init $content .= $ext_plugins . 'tinyMCE.init({' . $mce_options . '});';
// Add external plugins and init $content .= $ext_plugins . 'tinyMCE.init({extended_valid_elements : "iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]",' . $mce_options . '});';
That worked in my situation, I hope it helps other folks here apply a good temporary fix to a problem that should be addressed in later versions.
Something, anything – even a simple tag like:
{ignore_this} bunch of stuff {/ignore_this}
might encapsulate code that should be ignored by all the various levels of HTML cleanup. And yes, I realize this creates potential problems that the good folks at WordPress were probably trying to avoid.
Anyone want to write a plugin?
Thanks,
Chris