I’ve now written 4 cms’ and have decided as a personal project to create a core system that can easily be adapted to many tasks. Over the past 4 cms’ I’ve used the same code a lot and created a central core of utils (imaginatively called Gist!) but I want to go a step further and have a central system I can use straight off.
Read more…
Just a couple of udf to handle paths in sql server, not very solid but if your paths are valid they work well.
CREATE FUNCTION dbo.GetFileName (@Path varchar(512))
RETURNS varchar(255) AS
BEGIN
Return RIGHT(@Path, LEN(@Path) - dbo.LAST_INDEX(@Path, '\'))
END
Read more…
This is the start of a jQuery carousel. I’ve used a few carousels but they require a lot of css editing to get them to change widths etc. I wanted one that could easily adapt to displaying different numbers of items. It accepts a noOfItems config that defines how many items it displays and it adjusts it’s width accordingly. Early days but not bad for a few hours work
Read more…
Selectors in JQuery are extremely powerful. This is a simple page to test them and as a quick reminder as to what’s available.
Get a DOM object from a JQuery obj
$('#' + id).get(0); //get the dom object from the jquery wrapper
Only include object if JQuery is available
//only include if jquery is available
if (typeof jQuery != 'undefined') {
//class goes here
}
Read more…
In my cms’ I usually have the option of creating controls from the database. This is just a simple use for reflection but allows me to add controls to page just by adding a new row. If its one of my controls it supports a persistance system that allows the control to save and restore itself easily.
Read more…