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.1- New version using jQuery instead of Prototype. Simplified extension settings. Added option to use <strike>EE encode tag</strike> pMcode for email links so they get encoded. Upgrade note: I suggest disabling and completely removing the old version first before installing 1.1.
@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!
@textdriven: oops took too long to respond. It checks for fields that are set to (and saved or defaulted) as Textile. So if the default is something else and you select Textile as the formating I think it’s not updating. I’ll have to think of a way to live update that maybe…
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.
This seems to be working quite well, and I’m already looking forward to your update. Would it be easy to update with more buttons, beyond the default set?
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.
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!
Can you check the settings and make sure the paths are right? I know in the first version I had mixed up writing the “default” settings automatically when the extension gets installed… that may have crept back in…
The setting are correct, as far as I can tell (see attached pic). I have the ‘teh’ folder in the root of my site. Maybe some path in in the extension got tweaked inadvertently?
Oops - I see the problem - the “Config file URL” has the wrong extension - should be ....textile-editor-config.js (not .css). I think that’s some bad cutting and pasting on my part in the install function. Sorry about that.
Good deal. I updated the download, so if you’re going to install it new somewhere else you may as well grab a fresh copy so the paths start out right. (That’s the only change so no need to reinstall where it’s working). Thanks for helping me knock the bugs out here!
It is working now, after that change, but I’ll download the newest version.
One thing I did note is that it seems to conflict with “Textarea Resizer”, which I use on almost every site. I don’t know enough about extensions to know where the fault lies there, but I thought I’d bring it to your attention!
May I add that it might be handy to throw a link to the right of, or below, the Textile buttons that says something like “View Textile Formatting Guide” - which could (maybe) open in a new window and lead the user to either the Textile Reference at Hobix or The Textile Reference Manual at Threshold State.