ADD: I will fix that System folder path issue, too. I know exactly what you mean. The way most exteensions are written that include files, they wouldn’t even work with a masked control panel. Thanks for pointing it out.
Have you had a chance to update the paths in the extension so that it will work in a development site folder? Unfortunately, i’ve don’t have the know-how to do this myself, but would find the new version super useful.
One thing that I noticed is I missed being able to specify the number of rows of the text area as I liked that control over publish form matching text area size to the amount of content expected.
After a bit of tinkering, I noticed that when I removed the height style from the MarkItUp skin, that it was rendered by the number of rows. I then noticed you hid the number of rows select form, so I had to toggle back and forth to the textarea to set the rows and then go back to MarkItUp and save to record my selection.
Not sure I am making a feature request, but thought to share in case anyone else missed the feature. Maybe that could be a config option in setting?
Yeah, this thing could probably use a little love. I’m reticent to do so at the moment because…because…OK, because I’m lazy. The closer it gets to the end of Summer ‘08, the less I want to work on EE add-ons.
Really, probably all that needs to be done is to allow you to set the number of rows…which means I would unhide that option on the custom field screen.
Got some pressing client work this week, but I’ll see if I can add that to the add-on to-do list.
Finally got around to playing with this, works great so far. Nice work.
Note: I tried this on an install with a massive weblog list, and the publish dropdown z-index clashed with the Markitup buttons.
Easy fix, just added z-index: 10; to #publishdropmenu in the css for my cp theme.
I was looking for an easy way to switch from the default skin, and thought it was about time for me to get my hands dirty with an extension, so I added a new setting ‘skin_dir’:
Could not get this to work at all on a site with url of /~clientname. Spent plenty of frustrating time trying to get it to work but with no luck. I tried it on a site with a normal domain name, where EE is installed at root level and did manage to get it to work OK. Now I just have to figure out if its what I’m looking for… although anything to avoid having to install a WYSIWYG must surely be a good thing!
@angstmann: Did you see Chuchi’s post above about this? I have to update the extension to reflect this change, but maybe you can make the tweak and it will work for you?
I will say that this extension has some rough spots. It was whipped together relatively quickly, and I haven’t had a ton of time to update my extensions lately.
I’m using LG Image Manager and LG File Manager pretty much exclusively for file/image uploads. When they have their own field it worked great, but I wanted a way for them to enter an image or file link directly into a body field. Initially I just had a “Place File” link that called the MCFilemanager dialog, let you do your uploading, and inserted the url into the textarea.
When I started using the Markitup extension, I wanted to integrate the two. So we came up with this, in the textile set.js:
{ name: 'Picture', beforeInsert: function(h) { var ta = h.textarea, thisId = ta.id, thisVal = ta.value, cp = h.caretPosition, pre = thisVal.slice(0, cp), aft = thisVal.slice(cp, thisVal.length); mcImageManager.open('entryform',thisId,'',function(url) { ta.value = pre + '!' + url + '!' + aft; cp += 2 + url.length; if (ta.setSelectionRange) { ta.focus(); ta.setSelectionRange(cp,cp); } else if (ta.createTextRange) { var range = ta.createTextRange(); range.collapse(true); range.moveEnd('character', cp); range.moveStart('character', cp); range.select(); } }, {remove_script_host : true}); } }, { name: 'File', beforeInsert: function(h) { var ta = h.textarea, thisId = ta.id, thisVal = ta.value, cp = h.caretPosition, pre = thisVal.slice(0, cp), aft = thisVal.slice(cp, thisVal.length); mcFileManager.open('entryform',thisId,'',function(url) { ta.value = pre + '"Link text here...":' + url + aft; cp += 2 + url.length; if (ta.setSelectionRange) { ta.focus(); ta.setSelectionRange(cp,cp); } else if (ta.createTextRange) { var range = ta.createTextRange(); range.collapse(true); range.moveEnd('character', cp); range.moveStart('character', cp); range.select(); } }, {remove_script_host : true}); } },
Creates a button for image, which prompts MCimagemanager and inserts the !imageurl! textile markup with whatever you inserted. Same for file. but it just makes it a link to the inserted file.
Glad you’re digging this extension. Tim, if you have any ideas on how to make it better (a la the addition of the Skin Directory field) which I can add to an update - or even ideas on how to simplify the install, PM me or email me and let’s get those updates into the extension for everyone to use.
You’ve probably noticed there are some issues if you have more than one Markitup field of different types on a single Publish page, among other small things (I’m sure K-Swed could take a look at some of the JS under the hood and suggest how it might be optimized). Thanks!
Markitup/Textile fields are working fine running locally (MAMP) on my machine, but when I deploy to a remote server, my h1-h6 icons get messed up. (see screenshot)
I investigated, and the stylesheet from the default markitup is just overriding my textile set, its getting inserted in the head after my textile set….but only on the server, not locally….spooky. Same repo, same DB.
Local source, textile styles at the end, works as it should:
Thanks a ton for making this extension. I installed it last night and it works in that I can edit my text with markdown, but when I save it, or hit the preview button, it isn’t previewing as markdown. E.g #### My Header prints out as #### My Header, not
My Header
. I even wrapped the template variable with {exp:markdown}{bio_body}{/exp:markdown} thinking it would format properly, but it isn’t. I’m not getting any PHP or JS errors either.
Did you make sure that markdown was set as the format when you created the field? You create a ‘Markitup’ field type but I think you also need to set the format (others are “None”, “Auto BR”, and “XHTML”. Then in the template, you don’t need to wrap the field in the markdown tags.
@tilzinger: bcartier is right, you need to install the markdown plugin and set the field type to Markdown. You shouldn’t have to wrap anything on the templates.
Many hours and about 700 lines of PHP later, I think I have Markitup 1.5.0 ready to go. There are a number of enhancements:
- Can more easily handle multiple instances of different types on a single page (@timkelty, I think this might probably solve your problem above, with the default styles breaking things). This also means you can just comment out lines in one CSS file and they won’t affect the CSS for the other Markitup field types (initially, they all use the exact same classes…which led to problems)
- System Folder path issue has been fixed
- Added integration with LG Addon Updater (see pic)
- Improved the settings page, adding the “skin” setting (see pic)
- Cleaned up the code, using less hooks to do the work
- Tested with Playa extension and they both work fine
- MSM compatible - you can enable this extension on a site-by-site basis
A lot of work went into this thing, and I’m considering making this my first “commercial” add-on, albeit a very reasonable one. I think I need to do some more testing on it first. If this does go commercial, I will probably seriously look at a way to get the preview working for all field types - and listen to and work on suggestions for any improvemnets in a timely manner.
This revised version is definitely something I’d feel more comfortable using in a production environment (I don’t use the current version on any live sites).
But let me know if there is any interest in this - or, if everyone is cool with the previous version, carry on!
Huge props to Leevi Graham and his addon writing brilliance. I had damn near every one of his extensions open as reference when updating my code on this.
Brilliant Ryan, many thanks for this. I will be trying this out on the current client site I am working on.. I like to live dangerously I’ll let you know how it goes.