Forums / Suggestions / xhtml code in templates

xhtml code in templates

Author Message

Mikhail Chekanov

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

Alex Jones

Wednesday 17 March 2004 7:40:10 am

The eZ team is moving in this direction. Check out the article discussing the new Admin interface (http://ez.no/community/news/the_administration_interface_project) which touches upon the subject of XHTML and CSS usage. There is also a related thread (http://ez.no/community/forum/suggestions/the_administration_interface_project) discussing that article.

Better use of CSS/XHTML is important moving into the future.

Oh, on a side note, I would recommend dropping the term 'sidebar' as it implies placement on the page. IDs and Class names shouldn't imply placement, or for that matter style (like color, font-weight etc.) as future redesigns may not place that object in the same spot, or may choose to use a different method of styling. For example, I may choose to move the contents in the 'sidebar' to display at the top of the page. Perhaps a better term would be along the lines of 'sitemenu'; describing its contents instead of its placement.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Mikhail Chekanov

Thursday 18 March 2004 1:38:06 am

>...Check out the article discussing the new Admin interface
>...There is also a related thread...
Yes, i've read it - my post was inspired by the article

>...Oh, on a side note, I would recommend dropping the term 'sidebar' as it implies placement on the page...
yea, it implies "sidebar tree menu", not placement :) It can be placed anywhere - within left/right sidebar block, main area and so on.

--
mike
#6595551

Alex Jones

Thursday 18 March 2004 7:16:43 am

A valid point. Ultimately the name of 'sidebar' tree menu should be changed as well then. Separation of content and display (naming conventions included) should be reflected throughout the system.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

eZ debug

Timing: Jan 18 2025 11:18:52
Script start
Timing: Jan 18 2025 11:18:52
Module start 'content'
Timing: Jan 18 2025 11:18:52
Module end 'content'
Timing: Jan 18 2025 11:18:52
Script end

Main resources:

Total runtime0.1702 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.7031180.8438
Module start 'content' 0.00540.0050 768.546997.8516
Module end 'content' 0.01040.1598 866.3984535.0547
Script end 0.1702  1,401.4531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00352.0328200.0002
Check MTime0.00140.8165200.0001
Mysql Total
Database connection0.00040.206710.0004
Mysqli_queries0.126174.05601410.0009
Looping result0.00140.80641390.0000
Template Total0.159393.610.1593
Template load0.00090.558010.0009
Template processing0.158493.024110.1584
Override
Cache load0.00060.377710.0006
Sytem overhead
Fetch class attribute can translate value0.00070.424810.0007
XML
Image XML parsing0.00030.165710.0003
General
dbfile0.00160.9236200.0001
String conversion0.00000.002930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs