Wednesday 17 March 2004 6:50:15 am
I have a suggestion related to xhtml code in templates. It's simple, but...
Look, ez team is going to replace nested tables with nested divs and this way we can control all design-related stuff through CSS. But every package (including admin and standart) has different selectors, id's, etc.
The general idea is to standardize xhtml code within eZ by separating the layout from the design once again. :D
For example for article view:
<div id="content">
<div class="article">
<h3>Header goes here</h3>
<div class="intro">Intro</div>
<div class="body">
<img>
<p>Body text</p>
</div>
</div>
<div class="comments">
<div class="author">Author info</div>
<div class="body">Hello world!</div>
</div>
<div class="comments">
<div class="author">Author 2 info</div>
<div class="body">Hello 2 world!</div>
</div>
</div>
And for dinamic objects like sidebar tree menu:
<div id="sidebar">
<ul>
<li id="active" class="folder">News</li>
<ul>
<li id="active" class"folder">IT</li>
<li class="folder">Sport</li>
</ul>
<li class="infopage">About</li>
<li class="form">Contact us</li>
</ul>
</div>
So, as you can see, I've used unique IDs for the layout/logic and non-unique CLASSes to describe type of objects and their attributes.
H3 for article header was used because it is simple attribute, article body is more complicated (XML field with other tags) - so i've used div for it. And, finally, for the stylesheet:
#content {float:right;} #sidebar {float:left;}
#content div.article {background:#fff;}
.article h3 {font-size:120%;} #sidebar li#active {font-weight:700;color:red;}
This looks complicated, but with weel-formed rules for template xtml code (eZ team already have written rules for PHP and TPL coding) we can gain control over design-related stuff only with CSS stylesheets. Advantages: simple theming; quick redesign; clear xhtml structure.
--
mike
#6595551
|