Welcome Guest, Not a member yet? Register   Sign In
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS

[eluser]Phil Sturgeon[/eluser]
You don't think I'll be going to the pub on Friday? :coolhmm:

Last night we basically discussed how we can make modules, themes and CSS all get along. I think in the end we got half way there but I wandered off to think before we made a decision.

Option 1 - Module wrappers

A module is wrapped by a single view which has variables like $module_content, $module_header, $module_title, $module_footer etc and all modules just output to them. These are wrapped in standard <div class="module_title"> tags which can be styled in a theme.

Optionally, theme developers can make a separate wrapper file for a specific module to handle it in a different way.

This forces modules to follow the styling rules which can make life easier on the designers but will massively squash creativity and flexibility in modules.

Option 2 - CSS guidelines

Taking ideas from this approach I (in my mind) took the pro's and avoided the cons.

For starters, we wrap all module content in #module_title and #module_wrapper. Within the actual wrapper anything goes and module developers are free to do as they wish.

I think, all modules should contain layout specific CSS but leave out colors, fonts, etc. If they do that, they are fools and nobody will use their module. I would rather let developers have the option to be idiots than force them into making restricted code *cough*iPhone SDK*cough*.

Then, with the modules laied out theme designers can style up colors, fonts, sizes, etc for all general text, #module_title and #module_wrapper etc which will apply to pages and modules. Then if they want to override anything in the module CSS they can just use !important rules.

finally, we will give theme designers and module developers one other kick-ass tool. By outputting the segment array to the body tag as a class name, we can let them write specific CSS for a certain module, certain method or even if they want to go nuts, write custom CSS for a specific URL parameter like user/1. Madness!

Code:
&lt;body class="&lt;?php echo implode(' ', $this-&gt;uri->segments_array(); ?&gt;

This will produce a list of classes like below:

Quote:&lt;body class="news category pyrocms"&gt;

Doing this we can create CSS for any module and theme in the site.

Feedback please? I am obviously leaning towards option 2 but can I get some feedback on how to improve either? A few people joined tinychat but left pretty quickly as it was just me a Yorick hammering out ideas. Sorry!


Messages In This Thread
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS - by El Forum - 07-02-2009, 02:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB