5
I've looked a bit at these aligned 'problems'.
It seems mostly related to the use of template. All the leading spaces on a line with code dedicated to smarty are also present in the generated HTML.
In nearly all places I have looked at,
<{if ...)>,
<{foreach ...)> use the same indentation of the HTML code they are mixed with. Things can be even worse with
<{includeq ...)>...
For example in
theme/default/theme.html :
<table cellspacing="0">
<tr>
<{if $xoops_showlblock}>
<td id="leftcolumn">
<{foreach item=block from=$xoBlocks.canvas_left}>
<{includeq file="$theme_name/theme_blockleft.html"}>
<{/foreach}>
td>
<{/if}>
In order to keep a clean aligned, all smarty code should be left align and it should be written :
<table cellspacing="0">
<tr>
<{if $xoops_showlblock}>
<td id="leftcolumn">
<{foreach item=block from=$xoBlocks.canvas_left}>
<{includeq file="$theme_name/theme_blockleft.html"}>
<{/foreach}>
td>
<{/if}>
Coding standard (
https://docs.google.com/View?docID=dgb3svsv_86dx8xcsfr) doesn't speak about the good use of smarty directives.
Doing this, can lead to less readable templates, especially in complex ones. But sometimes, the code can even be, IMO, more readable because smarty code is easier to identify this way...
So my question is :
- Is this acceptable for you ?