
|
12.11.2004 Creating a wiki module for umbraco using around 0.3 KLOCs of code... For a demo some time ago I made a wiki module for umbraco and for that purpose I wrote 1 (as in one) single .NET usercontrol which was 292 lines long (including comments and auto-generated code made by VS.NET). It's written in c# and is not a beauty (after all - it was just made for a demo ;-)) - links to full source follows... Only 300 lines - am I kidding? The reason that it's only 300 lines of code, is because umbraco allready handles content storage, versioning and user control, so all I needed to do was creating the wiki-functionality. Basically that meant:
Looking into the source... // Validate user That's it. And using Web Matrix or Visual Studio .NET you even get IntelliSense to make coding even easier:
And the code for updating is almost the same: // Validate current user When I had finished writing my wiki, I made a couple of Public properties and some css classes for links to make it easier to customize. Now the css part makes it easy to format the different kinds of links (whether its new pages to be created or just links to existing pages), but the public properties can be read by umbraco and makes it possible for any user to modify settings in the wiki without a single line of code - just be dialogs automatically created be umbraco. All I needed to do was:
Register the wiki in umbraco
After that I'll edit my macro and tell it the location of my wiki control and when that is done, I get a button saying "Browse properties"... Let's try that:
Now there is the list of properties made in the usercontrol, and be checking the boxes, umbraco will create the properties inside our macro and make ui when the wiki is inserted. So let's try to insert the wiki macro into a template:
Voila - here's the result:
So a wiki is created using 0.3 KLOCs of code and registered inside umbraco with a few mouse clicks - are you getting ready for umbraco? Imagine how fast you could create forums, FAQ-lists and other content based web modules using umbraco... The release candidate of umbraco is really close, so hold your breath and prepare to switch to a content management framework that takes both developers and editors seriously..! Please mail me if you have any questions... You can see the full source code for the wiki here - published under GPL: wiki.ascx.cs and wiki.ascx. 0 Comment(s)...
Comments:
Post a Comment
Older stuff here... |
|
More banners here... To the weblog frontpage Email / Contact info umbraco - my company Call me through Skype Blog archive RSS Feed![]() commonme.org publicMIND urgent.dk asynkron Hr. Röser Interbreed OpenLife Loudthinking BlogBot.dk Tim O'Reilly - and his books steve mcconnel joel spolsky steve jobs bruce eckel ![]() |
|
|