Picocms is a project mainly written in C# and JAVASCRIPT, it's free.
A minimalist content management system written with C# and javascript for use on Windows Servers with IIS.
title: picocms README
author: Shawn Kent
targets: ASP.NET with .NET 3.5
requires: jQuery 1.4.1 or greater (the one that comes with Visual Studio 2010 projects works ;P)
Picocms offers a simple way of adding inline copy editing to web pages. Similar to larger content management systems, this allows website copy to be changed very quick and easily. Unlike the larger systems, it offers nothing other than copy editing. I made this system because some websites I develop are far too simple for a large content management system, but I still want my users to be able to change their copy without contacting me.
As simple as I could make it and avoid postbacks! The system has four parts:
1. server-side: .NET UserControl for outputting copy to web pages.
2. client-side: javascript for overlays and updating content.
3. server-side: HttpHandler for making updates to content.
4. server-side: Database
Now I will explain each of these:
The control takes a Tag and Key value and outputs an html tag as specified in Tag with its inner html set to the content specified by the Key. To make it really useful, I also output ANY OTHER attributes on this control into the html tag. It is important to use this as you would a normal html tag AND NOT AS YOU WOULD AN ASP.NET TAG! It really doesn't make sense to fill asp:TextBox with copy content, you can do that yourself if you'd like using the same mechanism I do to get content in content.cs. The intended use here is to fill simple html elements like div. So an example of how to fill a div using content.cs is:
<picocms:content Tag="div" Key="welcomemessage" style="padding:9px" title="Some Title.. is this even valid on divs?">
</picocms:content>
This will output a tag as such:
<div contentregion="welcomemessage" style="padding:9px" title="Some Title.. is this even valid on divs?">Content in here is the value stored for the key "welcomemessage"</div>
There are two reasons I am using the picocms:content control:
When content.cs is rendered, it gets content from the ASP.NET cache and stuffs it into the control! So there is caching and having lots of these content controls will not kill your database with connections.
In the web browser, an overlay is added on mouse-over to html tags that contain an attribute: contentregion. A button is then displayed so the content of that html can be edited. When clicked a TextArea appears containing the element's innerHtml. The user can edit the text and then click Save or Cancel. When Save is clicked, the value of the TextArea is inserted into the element and the text is sent back to the HttpHandler in #2 above.
This is an http handler which does two things:
If you are curious about anything more with the HttpHandler, go take a look. It is very simple.
Currently, I am using Linq2Sql to store content in a single database table. It wouldn't be too hard to get into /data/ContentRegion.cs and change what I've done to suit your own data needs! Any changes made here are BEHIND the cache so you will retain advantages of the ASP.NET cache even if you change how the data is stored/retrieved.
In the database of your application, you must create a table called picocms_ContentRegion. You can use this SQL script:
CREATE TABLE [dbo].[picocms_ContentRegion](
[ContentRegionID] [uniqueidentifier] NOT NULL,
[Key] [varchar](100) NOT NULL,
[Text] [nvarchar](max) NOT NULL,
CONSTRAINT [PK_picocms_ContentRegion] PRIMARY KEY CLUSTERED
(
[ContentRegionID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Add name of connection string to the database holding table picocms_ContentRegion.
Add the handler used for making updates to
Add a pages/controls directive to every webpage on your site.
If you have everything installed and there are no errors, yet you see no editing overlays then most likely it is because you are not logged-in.
HAVE FUN!