After coming across the very cool Textile Editor Helper plugin for Slate via this forum post a while back, I’ve been kicking around the idea of trying an extension for it. So I just did and thought I’d see if anyone finds it useful, or has any feedback on on my additions.
If anyone’s interested in trying it out I’ve attached it here, and an image to give you the idea. The original version didn’t have link or email buttons, so I added those as well, though one of the Slate guys told me they’d be adding that in the next version so hopefully their implementation will be nicer. I didn’t add the preview as I thought it would compete with EE’s own preview area and be confusing. Though a live preview could be cool, if perhaps overkill.
I’d love to hear what people think of this idea (as well as anything I could do to improve the extension itself of course).
update: 1.2 - New version requires jQuery for the Control Panel extension (bundled with EE 1.6.6+ or available here)
Link and Email custom buttons bugfixes: -IE7+ selection handling fixed (no more duplicating text) -Fixed selection handling in all other browsers (text stays selected instead of moving cursor to end of field)
Now available for download at Github (click the download button, then choose zip or gzip) … or attached right here for people having trouble with Github.
update: 1.1- New version using jQuery instead of Prototype. Simplified extension settings. Added option to use EE encode tag pMcode for email links so they get encoded.
Upgrade note: I suggest disabling and completely removing the old version first before installing 1.1.
current version: 1.2.0 (build 20090331)
That’s very nice, simple too. Would you consider making a plugin for comments, too, similar to the HTML buttons plugin?
I’d also like to encourage you to submit this to our Add-on Library.
@Lisa: Thanks, I’m hoping this fits the bill for me an my clients between having to resort to tinymce or fck (yikes!) and just sending them to an external documentation page and telling them Textile (or Markdown for that matter) is “good for them”. Plugin wouldn’t be that hard I’d guess, I may take a look. And I think I’ll kick the tires a bit before I submit it though…
@textdriven: I’ve tried it on a couple EE installs without issue. Can you check in the settings and make sure the paths area all correct adn save the settings again? I default them based on where I think they should go, but that would be my first guess. And thanks for giving it a whirl!
I’m a big fan of Textile, and using it with EE, so thanks for this. I look forward to trying it out when I get a chance.
I put together a live preview (in the comments area of a previous site) build utilizing Textile (from some scripts I found online). That never got used, but I know I have the markup/code around.
I just tried installing this on a relatively new install and it’s not putting the editing buttons in, and it is also throwing a couple things at the top of the page like so:
Notice: Undefined variable: EXT in /home/site/public_html/system/extensions/ext.textile_editor.php on line 56
Notice: Undefined variable: EXT in /home/site/public_html/system/extensions/ext.textile_editor.php on line 58
So I went in and changed line 54 from
global $DB, $IN, $PREFS;
to
global $DB, $IN, $PREFS, $EXT;
Looks like I had to add the $EXT there - is that the correct fix? Everything seems to be working OK now.
Ah yes that is correct. Sorry about that, I forgot I added the “last_call” check to make sure this wouldn’t interfere with any other extensions using the same extension hook and forgot to add the global. I’ll fix that and also should be posting an update (hopefully later today) as I’ve got toggling working for fields that show the format select list (xhtml, br, none, etc.) to initialize or destroy the toolbar when you change the formatting selection. Also got some tips from the Slate guys who created the toolbar on a cleaner way of adding the custom buttons.
I’ve updated the extension so it now toggles the toolbar when you change the formatting pulldown for your text area. Also cleaned a few things up and fixed the errors. Grab 1.0.2 up top.
@mdesign: If you’re just looking to add simple open/close tags that don’t require a dialog prompt or anything special it’s pretty simple to add your own buttons. If you look in /teh/javascripts/textile-helper-config.js you’ll see the first several lines are the default buttons and it’s fairly easy to duplicate one of those lines and replace a few things. Below that you’ll see where I added the custom link button code that required a new callback function to handle the user prompts - it’s a bit more complex but still pretty simple. And the images are all just the ever popular FamFam Silk icons.
Let me know if you’ve got particular buttons in mind I’m happy to help or maybe add them into the next version. An image button was my next idea.
…off to play with 1.6 some more…
I can’t get this new extension (1.0.2) to work. I did a fresh install on a new site where I want to use it. I do get a light gray bar where the buttons should go, and it does disappear/reappear when I change the field formatting. I’ll try monkeying with it a little bit more, and seeing if there might be a conflict with another extension or something. Or heck, I might have not put something in the right place!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.