Discussion:
Xaraya_Classic theme menu blocks logic
Fournier Daniel
2004-05-03 09:14:23 UTC
Permalink
I'm experimenting with theme design, taking Xaraya_Classic theme as a
starting point.
Regarding left and right menu blocks logic, wouldn't it be simpler to
write it this way:

--------------------------------------------
<xar:if condition="empty($leftblocksgroup)">
<style>td#leftmenus { display:none; }</style>
</xar:if>
<xar:if condition="empty($rightblocksgroup)">
<style>td#rightmenus { display:none; }</style>
</xar:if>

<table id="classiccontentarea">
<tr>
<td id="leftmenus">
<div id="leftmenuswrapper">
<div class="iewintablefixer">
<xar:var name="leftblocksgroup"/>
</div>
</div>
</td>
<td id="maincontent">
<div class="iewintablefixer">
<xar:var name="centerblocksgroup"/>
<xar:module class="modulespace" main="true" />
</div>
</td>
<td id="rightmenus">
<div id="rightmenuswrapper">
<div class="iewintablefixer">
<xar:var name="rightblocksgroup"/>
</div>
</div>
</td>
</tr>
</table>
--------------------------------------------

Daniel
Andy Varganov
2004-05-03 10:06:33 UTC
Permalink
it should work in css enabled browsers, providing you only use <style> tag in
the head section (it's illegal in body), but there would be a slight markup
overhead in every page which doesnt use left or right - depends on your site
visitors, of course whether they like it or not :)
Post by Fournier Daniel
I'm experimenting with theme design, taking Xaraya_Classic theme as a
starting point.
Regarding left and right menu blocks logic, wouldn't it be simpler to
Fournier Daniel
2004-05-03 14:41:53 UTC
Permalink
Post by Andy Varganov
it should work in css enabled browsers, providing you only use <style>
tag in the head section (it's illegal in body),
Well, I forgot to break my snippet in two parts: 1st one included in
<head/> element (style declaration part), 2nd one in <body/>.
Post by Andy Varganov
but there would be a
slight markup overhead in every page which doesnt use left or right -
depends on your site visitors, of course whether they like it or not :)
Surely, but the actual Xaraya_Classic theme undergoes an heavier markup
overhead, that's what I wanted to point out.
Post by Andy Varganov
Post by Fournier Daniel
I'm experimenting with theme design, taking Xaraya_Classic theme as a
starting point.
Regarding left and right menu blocks logic, wouldn't it be simpler to
Andy Varganov
2004-05-03 15:46:14 UTC
Permalink
Post by Fournier Daniel
Surely, but the actual Xaraya_Classic theme undergoes an heavier markup
overhead, that's what I wanted to point out.
and here you're not correct - see, the weight of markup in the template is not
necessarily 'propagated' to the weight of its output (webpage markup).. In fact
your version will result in 'heavier' webpage than the original, because you
leave the unneeded tags on the page, while 'hiding' them with css - just look at
what your template outputs.. and the css itself in the head also adds markup to
EVERY page. So if you were suggesting to change the original theme with your
version, I failed to see any advantages of it.

Andy
Fournier Daniel
2004-05-04 09:03:33 UTC
Permalink
Post by Andy Varganov
Post by Fournier Daniel
Surely, but the actual Xaraya_Classic theme undergoes an heavier
markup overhead, that's what I wanted to point out.
and here you're not correct - see, the weight of markup in the template
is not necessarily 'propagated' to the weight of its output (webpage
markup).. In fact your version will result in 'heavier' webpage than the
original, because you leave the unneeded tags on the page, while
'hiding' them with css - just look at what your template outputs.. and
the css itself in the head also adds markup to EVERY page. So if you
were suggesting to change the original theme with your version, I failed
to see any advantages of it.
That's a good explanation.

However, I don't think this extra markup will make a noticeable latency
on the client side.

For instance, if I have no left menu, I get this line (<head/> child):

<style>td#leftmenus { display:none; }</style>

and (<td id="leftmenus"/> child):

<div id="leftmenuswrapper">
<div class="iewintablefixer"></div>
</div>


These 3 uneeded elements to parse on client side are nothing compared to
the tens of elements to be parsed on server side to decide what is the
exact output.

But the main benefice is clearly in the template readability: no
duplication of code, which is always error prone when you want to modify
something.

Daniel
Andy Varganov
2004-05-04 10:15:19 UTC
Permalink
Post by Fournier Daniel
However, I don't think this extra markup will make a noticeable latency
on the client side.
no, in practice it wont.. however, serving clients 'empty' structures, like the
table cells in your example, is a big NO-NO in my books :) that's why i
completely re-wrote the 1st version of xaraya_classic (see early 0.9+ releases
for comparison) in order to achieve the 'cleanest possible' output.
Post by Fournier Daniel
<style>td#leftmenus { display:none; }</style>
i suspect you're after a dynamic css but we simply dont have a 'nice' official
solution for it in xaraya yet.. although it doesnt stop you from experimenting.
Post by Fournier Daniel
These 3 uneeded elements to parse on client side are nothing compared to
the tens of elements to be parsed on server side to decide what is the
exact output.
not sure i could see the problem on the server side - template is compiled
before it's served to a client, there is nothing extra to parse. The logic is as
follows: no content -> no output -> no unnecessary structures to fly about and
pollute clients rendering engines.
Post by Fournier Daniel
But the main benefice is clearly in the template readability: no
duplication of code, which is always error prone when you want to modify
something.
see above, at this stage i'd care much more about the structure of output than
about the structure of template, but i'm not arguing that having both sorted out
would be nice too :)

Andy
Fournier Daniel
2004-05-04 12:02:44 UTC
Permalink
Post by Andy Varganov
Post by Fournier Daniel
However, I don't think this extra markup will make a noticeable
latency on the client side.
no, in practice it wont.. however, serving clients 'empty' structures,
like the table cells in your example, is a big NO-NO in my books :)
that's why i completely re-wrote the 1st version of xaraya_classic (see
early 0.9+ releases for comparison) in order to achieve the 'cleanest
possible' output.
Post by Fournier Daniel
<style>td#leftmenus { display:none; }</style>
i suspect you're after a dynamic css but we simply dont have a 'nice'
official solution for it in xaraya yet.. although it doesnt stop you
from experimenting.
Post by Fournier Daniel
These 3 uneeded elements to parse on client side are nothing compared
to the tens of elements to be parsed on server side to decide what is
the exact output.
not sure i could see the problem on the server side - template is
compiled before it's served to a client, there is nothing extra to
parse. The logic is as follows: no content -> no output -> no
unnecessary structures to fly about and pollute clients rendering engines.
Post by Fournier Daniel
But the main benefice is clearly in the template readability: no
duplication of code, which is always error prone when you want to
modify something.
see above, at this stage i'd care much more about the structure of
output than about the structure of template, but i'm not arguing that
having both sorted out would be nice too :)
Andy
That's meaningful.

Anyway, isn't possible to have a simpler solution:


<table id="classiccontentarea">
<tr>

<xar:if condition="!empty($leftblocksgroup)">
<td id="leftmenus">
<div id="leftmenuswrapper">
<div class="iewintablefixer">
<xar:var name="leftblocksgroup"/>
</div>
</div>
</td>
</xar:if>

<td id="maincontent">
<div class="iewintablefixer">
<xar:var name="centerblocksgroup"/>
<xar:module class="modulespace" main="true" />
</div>
</td>

<xar:if condition="!empty($rightblocksgroup)">
<td id="rightmenus">
<div id="rightmenuswrapper">
<div class="iewintablefixer">
<xar:var name="rightblocksgroup"/>
</div>
</div>
</td>
</xar:if>

</tr>
</table>

or, even cleaner, getting rid of the table layout:

<div id="classiccontentarea">

<xar:if condition="!empty($leftblocksgroup)">
<div id="leftmenus">
<!-- throw away IE table deficiency -->
<xar:var name="leftblocksgroup"/>

</xar:if>

<div id="maincontent">
<xar:var name="centerblocksgroup"/>
<xar:module class="modulespace" main="true" />
</div>

<xar:if condition="!empty($rightblocksgroup)">
<div id="rightmenus">

<xar:var name="rightblocksgroup"/>

</div>
</xar:if>

</div>



Daniel

Chris Dudley
2004-05-03 11:43:25 UTC
Permalink
Post by Fournier Daniel
I'm experimenting with theme design, taking Xaraya_Classic theme as a
starting point.
Regarding left and right menu blocks logic, wouldn't it be simpler to
--------------------------------------------
<xar:if condition="empty($leftblocksgroup)">
<style>td#leftmenus { display:none; }</style>
</xar:if>
<xar:if condition="empty($rightblocksgroup)">
<style>td#rightmenus { display:none; }</style>
</xar:if>
<table id="classiccontentarea">
<tr>
<td id="leftmenus">
<div id="leftmenuswrapper">
<div class="iewintablefixer">
<xar:var name="leftblocksgroup"/>
</div>
</div>
</td>
<td id="maincontent">
<div class="iewintablefixer">
<xar:var name="centerblocksgroup"/>
<xar:module class="modulespace" main="true" />
</div>
</td>
<td id="rightmenus">
<div id="rightmenuswrapper">
<div class="iewintablefixer">
<xar:var name="rightblocksgroup"/>
</div>
</div>
</td>
</tr>
</table>
--------------------------------------------
Daniel
urghh tables

/me wishes the world would wake up and stop using IE so CSS could be
more widespread.

miko
Fournier Daniel
2004-05-03 14:51:24 UTC
Permalink
Post by Chris Dudley
Post by Fournier Daniel
I'm experimenting with theme design, taking Xaraya_Classic theme as a
starting point.
Regarding left and right menu blocks logic, wouldn't it be simpler to
--------------------------------------------
<xar:if condition="empty($leftblocksgroup)">
<style>td#leftmenus { display:none; }</style>
</xar:if>
<xar:if condition="empty($rightblocksgroup)">
<style>td#rightmenus { display:none; }</style>
</xar:if>
<table id="classiccontentarea">
<tr>
<td id="leftmenus">
<div id="leftmenuswrapper">
<div class="iewintablefixer">
<xar:var name="leftblocksgroup"/>
</div>
</div>
</td>
<td id="maincontent">
<div class="iewintablefixer">
<xar:var name="centerblocksgroup"/>
<xar:module class="modulespace" main="true" />
</div>
</td>
<td id="rightmenus">
<div id="rightmenuswrapper">
<div class="iewintablefixer">
<xar:var name="rightblocksgroup"/>
</div>
</div>
</td>
</tr>
</table>
--------------------------------------------
Daniel
urghh tables
/me wishes the world would wake up and stop using IE so CSS could be
more widespread.
miko
Being a Linux user, I definitely agree and surelyshall move away this
table layout in favour of a pure CSS one -- a nice "elastic design"
(<http://www.alistapart.com/articles/elastic/>), for instance.
Loading...