Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'd like to make a Markdown data type and was wondering how to change the data types output at render only on the front end.
I've seen the tutorials on nibble for creating custom data types, but the problem is, i need to change what is output at the point it is rendered on the front end, but maintain it's raw state during editing.
Anbody got any advice on the best way to do this?
The easiest way would be to
- add post parsing in the Save method to store the data that's supposed to be used on the front end (ie so it's html and not markdown that's saved)
- Convert the html 2 markdown before the render method in your control
The optimal way would be to
- leave the control to use and store markdown
- override the ToXml() method on the IData class in your control to convert markdown to html when it's published (look at the related links data type in the editorControls project for inspiration)
Hope this helps! I'd love to see a markdown data type in the core, so if you're willing to add this to the core distribution I'd be happy to help you move on :-)
Just throwing in a link for thread readers who wonders what Markdown is:
Thanks for the help hartvig, thats exactly the starting point I needed.
I'd be more than happy for anything I develop to be added to the core. I'll keep you posted of my progress.
Ok, here it is, let me know what you think.
In terms the markdown tranformer, I've used the Markdown.NET library as written by Milan Negovan which you can find here
The zip should include all of the source code as well as all assemblies referenced so it should be everything you need, aswell as compiled binaries ready for you to install.
All the best
In case anyone stumbles on this thread, I think Matt's code ended up forming the basis of Lee Kelleher's Markdown Editor package:
TinyMCE is living hell, so I vote with Niels to add Markdown to the core! :)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted