Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Custom TinyMCE WP Editor Button / Dialog WordPress

  • SOLVED

Hi guys,

I need to make some custom buttons in the editor to wrap content in my shortcodes.

I want the code to create custom editor button which when clicked produces a dialog with two text areas and a 'Submit' button which then returns the data I input into those two textareas wrapped in my shortcodes to the editor without page refresh.

Please supply me the code and claim your reward. =)

Answers (5)

2011-01-26

juan manuel incaurgarat answers:

try this on your TinyMCE declaration


<script type="text/javascript" src="<your installation path>/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
theme_advanced_buttons1 : "mybutton,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
plugins : 'inlinepopups',
setup : function(ed) {
// Add a custom button
ed.addButton('mybutton', {
title : 'My button',
image : 'img/example.gif',
onclick : function() {
// Add you own code to execute something on click
ed.focus();
ed.selection.setContent('Hello world!');
}
});
}
});
</script>

<form method="post" action="somepage">
<textarea name="content" style="width:100%">
</textarea>
</form>

if that works, i dont expect $50.
i think 30 will be fair.

do you need me to explain the code?
if you like, i can code it for you on your site and therefore have the $50


drew comments:

You have no contact details on your profile. But yes, I'll take you up on your offer. ;) How do I contact you?


juan manuel incaurgarat comments:

email me at [email protected]
and thank you :)

2011-01-27

Oleg Butuzov answers:

sourcecode for required by you plugin


Oleg Butuzov comments:

going sleep now. any questions by mail butuzov-to-made.com.ua

2011-01-27

paul de wouters answers:

you could give this plugin a try : http://wordpress.org/extend/plugins/post-snippets/

2011-01-28

Joachim Kudish answers:

This tutorial explains it in detail. Just follow the steps and customize based on what you need to do.
http://net.tutsplus.com/tutorials/wordpress/wordpress-shortcodes-the-right-way/


drew comments:

Thanks very much for posting this tutorial, you are awesome! However, I do already have 'Juan' working on a custom solution so I can't reward you on this occasion but thanks for the reply, hopefully it will help other Googlers in future searches.


Joachim Kudish comments:

Not that I particularly care about the money, but there is a way to split the prize with WPQuestions.

Anyways, glad you found a solution.
Cheers,

2011-01-29

Denzel Chia answers:

Hi,

If you are still interested, I can write you a plugin specially for this.
Please send me your detail requirements to [email protected]

To show you that I am capable of writing such a plugin, you can take a look at my vimeo quicktag tinymce plugin http://wordpress.org/extend/plugins/vimeo-quicktags/screenshots/
as a reference.

Looking forward to your email.

Thanks.
Denzel