Styling Nucleus

August 5th, 2005

Now in the process of creating some templates and skins to incorporate my latest big design into Nucleus, a very nice PHP content management system.

The documentation is well written with examples; so you’ll find most of your answers to any queries you have there. The documentation pertaining to styling Nucleus resides in “nucleus[version-number] → nucleus → skins.html”. If you’re like me, then you’ll be after “Writing skins with Export/Import in mind”, so scroll down the page a bit until you reach it. I managed to follow the instructions without any problems until I got to this bit:

The contents of the skinparts then becomes kind of trivial: (I’m not defining them all, you’ll get the point by seeing the most important ones)

For some reason I couldn’t understand what they meant as “skin parts”. After a little while though, I caught on. I suppose it was because of the template and skin system Nucleus uses. The skin bit influences the header and footer of the page (that you would have created earlier if you followed the documentation) along with which templates are used to make blocks of content: archives, errors, items, etc. This happens to be what the “skin parts” are; parts that have special Nucleus call code that includes the template, as required for different pages, such as:

<%blog(vista/main,10)%>

This would be to include the template you made for the “main” (or index if you like, following the default theme). As I said, I caught on where to put the code, and that’s in the administration area under “Skins → [scroll to your skin] → edit”, then just click on each of the “skin parts” you want to edit in turn.

To create your own templates that can be included with the skin parts, I find cloning default’s the easiest way; and just modifying them from there. If you also choose to just clone the default skin instead of following the documentation, then you might fall into the trap of editing cloned templates, just to find that any changes you make are not reflected in your site. The reason being because the cloned default style parts are all pointing their include code to the “default/items” and “default/index” templates. So you’ll need to go through the style parts in your cloned default style changing them thus:

<%archive(default/index)%>

to

<%archive([yourstyle]/index)%>

This being only one example; you’ll have to comb through correcting all references to the old templates.

I haven’t been using Nucleus for too long; my head is somewhat swimming with styles / parts / templates (as your’s might be too from reading this post), but it’s very encouraging to not see any PHP when styling, as it just gets messy mixing it with xHTML and the like.

Comments are closed.