- Moderated by:
- Support Team
-
- rank:
-
Professional
- registered:
- September 2002
- Status:
- offline
- last visit:
- 19.11.08
- Posts:
- 879
Currently a lot of you developers out there start working with all the fine stuff in .8 and we already have a bunch of .8-only modules. Very nice modules! But there are two things that makes webmaster's life with your modules hard: You HTML and you CSS.
From the modules I have tested I see that most of you really try to stay up to date with current ideas about good HTML. I haven't seen any layout tables for months. Many module devs even try to put semantics into their work.
No matter there are some things, I'd like to point out and discuss with you.
1. "Divitis" is the name of a HTML coding style that puts every possible Tag into div-Tags. I personally only use divs for the general positioning of my layout: header, content, left block, right blocks, footer. Anything else doesn't need divs around it. You can position every other tag in any way you can position and style divs.
2. Some of you use a separate class or ID for every single piece of content. This makes the code seems bloated and hard to maintain. Please use only as few classes as possible.
3. Some modules have a very great design but it doesn't really adjust to my own themes. Please don't define the style of h-tags, p, ul, ol ASO. in terms of color, line-height or font-size and style. I think most webmasters already have a site wide definition for these tags and want all h2-tags look the same all over the site.
4. Use the CSS inheritence system for a slim style sheet: In .8 everything your module produces is put into a div:
Code
<div id="pn-maincontent" class="pn-module-YOUMODULE">
So if you want to style you module use e.g.:
Code
#pn-maincontent.pn-module-YOUMODULE * h2 {}
to make every h2 look the same in your module.
5. Please don't use h1 - h1 is the site's name.
[/list]
These are no official guidelines - only my personal opinion which I wanted to discuss, in order to develop a list of tips for module developers.
--
best regards from Kiel, sailing city
Steffen Voss
Member of the PostNuke Steering Committee
Read The Zikulan's Blog -
- rank:
-
Professional
- registered:
- September 2006
- Status:
- offline
- last visit:
- 21.11.08
- Posts:
- 1450
Excellent observations!
I agree and i practice all that points
In this moment, i'm building a Blank Xanthia 3 theme, with a clear structure and clear CSS definitions. I'll ask for some review later.
I guess it'll be three versions:
* simple theme without logic
* simple theme with logic and 'centralized' templates to improve maintanibility.
* advanced theme with new-block-positions examples
I think that the default structure of the themes, are easy for Graphic Designers, where they can modify the master.htm, home.htm ... with their preffered applications; but some developers, preffer to introduce some logic into that templates to improve the maintanibility centrralizing the layout. Well, i'm seeing that this can be a new topic of discussion.
For me, your tips are clear
and by now i haven't new ones.
Later!
--
- Mateo T. -
Mis principios... son mis fines -
- rank:
-
Freshman
- registered:
- April 2004
- Status:
- offline
- last visit:
- 23.04.08
- Posts:
- 27
The header (h1 - h6) tags are meant to be used to define an outline of the page's content, and that is how search engines read them. There's no reason you shouldn't be able to use h1 tags in your module's content if that helps outline the page more effectively.
IMHO.
--
--
Ben Birney
http://www.tilsontech.com/
http://www.sophiasfall.com/ -
- rank:
-
Professional
- registered:
- September 2002
- Status:
- offline
- last visit:
- 19.11.08
- Posts:
- 879
@bbirney: But if take a "real" document it always only has one major headline (like "PostNuke Handbook") which would equal the name on the cover of the book. If you have a site called "PostNuke Support Community" that would be the equivalent of it. All the stuff inside the book or on that site would be of a lower order -> h2-h6
--
best regards from Kiel, sailing city
Steffen Voss
Member of the PostNuke Steering Committee
Read The Zikulan's Blog -
- rank:
-
Moderator
- registered:
- March 2002
- Status:
- offline
- last visit:
- 26.08.08
- Posts:
- 7720
The key for me is for developers, by default, to keep it simple. Use valid, semantic markup. If something is a list use list tags, if something is tabular use a table etc. If all module templates follow this simple guideline it'll allow the theme to do the work of styling the output.
I think that, perhaps, for too many developers the output layer is an afterthought. We concentrate so much on the underlying code but the output of often put together in five minutes with an 'as long as it works it's ok' approach.
-Mark -
- rank:
-
Freshman
- registered:
- April 2004
- Status:
- offline
- last visit:
- 23.04.08
- Posts:
- 27
kaffeeringe.de
@bbirney: But if take a "real" document it always only has one major headline (like "PostNuke Handbook") which would equal the name on the cover of the book. If you have a site called "PostNuke Support Community" that would be the equivalent of it. All the stuff inside the book or on that site would be of a lower order -> h2-h6
I believe the conventional SEO wisdom is that the "major headline" is in the title tag, not in h1s.
--
--
Ben Birney
http://www.tilsontech.com/
http://www.sophiasfall.com/ -
- rank:
-
Professional
- registered:
- September 2002
- Status:
- offline
- last visit:
- 19.11.08
- Posts:
- 879
title is a meta tag - not part of the document - SEO is a different story.
--
best regards from Kiel, sailing city
Steffen Voss
Member of the PostNuke Steering Committee
Read The Zikulan's Blog -
- rank:
-
Professional
- registered:
- November 2003
- Status:
- online
- Posts:
- 1675
Excellent thread Steffen, I've been theming a project I'm creating and am running into lots of situations where I'm having to bloat my custom module templates with simpler replacements as well as having to create redundant CSS entries to default element values... I am guilty of this myself in my RosterMaster module.
Divitis heh, I'd never heard that, but I knew it existed. I think one of the biggest problems here is module themers not understanding block level elements. For instance wrapping a list in a div to control it's placement/behaviour/formating, a div has the same properties and behaviour as a ul/li.
For example this:
Code
<div>
<div>
<h2><!--[ $Title ]--></h2>]
<p><!--[ $Stuff ]--></p>
</div>
<div>
<h3>Menu</h3>
<div>
<ul>
<!--[ foreach... ]-->
<li>menu item</li>
<!--[ /foreach ]-->
</ul>
</div>
</div>
<div>
<table>
<!--[ foreach from=$TabularData... ]-->
<tr>
<td><!--[ $Things... ]--></td>
</tr>
<!--[ /foreach ]-->
</table>
</div>
</div>
Displays identically to this (or should):
Code
<h2><!--[ $Title ]--></h2>]
<p><!--[ $Stuff ]--></p>
<h3>Menu</h3>
<ul>
<!--[ foreach... ]-->
<li><!--[ $menuitem... ]--></li>
<!--[ /foreach ]-->
<table>
<!--[ foreach from=$TabularData... ]-->
<tr>
<!--[ foreach from=$TabularItems... ]-->
<td><!--[ $item... ]--></td>
<!--[ /foreach ]-->
</tr>
<!--[ /foreach ]-->
</table>
</ul>
And cascading style sheets should cascade, rather than adding classes to each element (this makes organising stylesheets easier too):
Code
.pn-module-YOUMODULE h2{ ... }
.pn-module-YOUMODULE h3{ ... }
.pn-module-YOUMODULE p{ ... }
.pn-module-YOUMODULE ul{ ... }
.pn-module-YOUMODULE ul li{ ... }
.pn-module-YOUMODULE table{ ... }
.pn-module-YOUMODULE table tr{ ... }
.pn-module-YOUMODULE table td{ ... }
That being said, divs can be quite usefull when you want to start throwing doc element groups around to the right or to the left and up or down a few pix.
Anyways, just some examples to help other simplify.
--
Under Construction! -
- rank:
-
Professional
- registered:
- September 2002
- Status:
- offline
- last visit:
- 19.11.08
- Posts:
- 879
True. Learning the difference between block and inline elements really opened my eyes and made life a lot easier.
--
best regards from Kiel, sailing city
Steffen Voss
Member of the PostNuke Steering Committee
Read The Zikulan's Blog -
- rank:
-
Professional
- registered:
- September 2002
- Status:
- offline
- last visit:
- 19.11.08
- Posts:
- 879
What Beautiful HTML Code Looks Like
--
best regards from Kiel, sailing city
Steffen Voss
Member of the PostNuke Steering Committee
Read The Zikulan's Blog -
- rank:
-
Professional
- registered:
- September 2002
- Status:
- offline
- last visit:
- 19.11.08
- Posts:
- 879
The 100% Easy-2-Read Standard
--
best regards from Kiel, sailing city
Steffen Voss
Member of the PostNuke Steering Committee
Read The Zikulan's Blog
