Last post Dec 02, 2005 01:51 PM by emaynard
Nov 29, 2005 02:36 AM|spankmebandit|LINK
I had a really interesting request today from sales. The client wants a different skin for each section of the site. Well my reponce was that they would have to select the appropriate skin every time they added a page. This isn't very helpful, open adv settings,
select site skins, select the correct one. He wanted it to happen automatically, and it should.
Thinking about it we decided why wouldn't you want a new page, if it has a parent, to inherit the skin from its parent? Clearly if you select a skin this would override this and you can edit a page to chnage this.
This allows a skin to be assigned to a top level page and all its children (sub pages) when added will get that skin assigned. Sounds great.
Most sites have two skins, a home page and an inner page. These sites remain uneffected.
So all that is need is a simple change to the addtab stored procedure before the insert:
IF isnull(@ParentId,0) <> 0 and isnull(@SkinSrc,'') = ''
SELECT @SkinSrc = SkinSrc
WHERE TabID = @ParentId
What this means is that when a new page is added if it has a parent and has no skin selected then go and get the value of its parents skin. Simple.
So with that solved in 15min it then took an hour to get it be installed simply. We do not modify the core, we want to be able to easily upgrade to new versions. So how to best package a simple SQL script? I ended up with a skin object, if you can help
me with a better way plpease comment. Basically we current install a folder full of 3rd party modules so this way i just added it to the folder and it will run the script seemlessly.
I hope this is usefull to others - personnally i would like some feedback about what you think and whether I should submit it to the core team.
Nov 29, 2005 06:02 PM|spankmebandit|LINK
Dec 01, 2005 11:28 AM|emaynard|LINK
Dec 01, 2005 07:30 PM|spankmebandit|LINK
Dec 02, 2005 01:51 PM|emaynard|LINK
Actually, I double checked and I'm still on
3.0.13 so that explains it.
Appreciate the script for the conatiners as well. I'll give that a try.