Hey I'm Lee. My blog was put up to house my strange thoughts, ramblings, nuggets of information I can refer back to and document my learning curves on new dev stuff and fitness regimes.

All thoughts and comments on here are my own, and in no way reflect my employer - I also take no responsibility for spelling, grammar, terminology, accuracy of facts etc... So read at your own risk!

Blogs I Read

Sites I Like

My First Custom DataType

I have been delving around quite a lot with Umbraco this week, as we are building quite a cool little site for a client which enabled me to have a play with some bits of Umbraco I haven't explored before.  Feeling Umbraco'd up, and after being prompted to read Tims Custom DataType post by Niels SkinBrowser blog post I thought I'd create my first custom Datatype.

Well I thought I'd go super complex and create a DataType that would take a YouTube URL and display the video… Oh yes… AND wait for it… The DataType would allow you to have two (Yes you read that right… two) settings to choose the height and width. [more]

I had a bit of a problem figuring out saving multiple settings, but after I had finished Jesper posted up an example - So I can hopefully use it in the next one I do.  Well would you believe it actually works, and I have even packaged it up in case you don't believe me (hehehe), and put the source code (Bottom of the page) as well so you can see how I did it.

Just a little finishing note, anyone who is thinking about having a go at a custom datatype - Do it, if I can create something so can you :)

admin

props

prop2

done

Obviously if you do want to add lots of videos I suggest you use the much better packages here - http://our.umbraco.org/projects/tag/video#projectList - This is a really simple example I have made

Source Code: Download

Package: Download

Back to top