1
tititou36
Generated HTML code layout
  • 2009/8/16 11:23

  • tititou36

  • Just popping in

  • Posts: 16

  • Since: 2009/8/15


Hi, when looking at HTML output generated by xoops, some times the layout looks terrible.

There are many places where it is not consistant :
- mix of tab and spaces
- non consistant number of spaces
- unaligned code
- missing or extra spaces

I wanted to know if you would find usefull if I send patches about it or if it is not an important issue for you ?

2
ghia
Re: Generated HTML code layout
  • 2009/8/16 11:58

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Yes, please do!
We are looking always for improvement.

3
tititou36
Re: Generated HTML code layout
  • 2009/8/16 13:36

  • tititou36

  • Just popping in

  • Posts: 16

  • Since: 2009/8/15


Ok, i'll work on it in order to improve XOOPS the way I can.

Where should I post patches ? SF.net patches tracker ? One of the forum in xoops.org ? Mail ? Direct update of SVN repository ?

What is the prefered format ? Diff file ? Complete modified file ?

4
trabis
Re: Generated HTML code layout
  • 2009/8/16 23:17

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Hi tititou36, thanks for your time!
You can commit bug fixes on svn repository. Please provide us your username so we can give you commit access.

This 2.4.x will be focused on bug fixes, your help will be much appreciated

PM me or Mamba ok?
See you.

5
tititou36
Re: Generated HTML code layout
  • 2009/8/17 21:40

  • tititou36

  • Just popping in

  • Posts: 16

  • Since: 2009/8/15


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 ?

6
trabis
Re: Generated HTML code layout
  • 2009/8/17 22:08

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


I'm ok with it. Sometimes I do just that.
Let theme designers have a word pls.

7
ghia
Re: Generated HTML code layout
  • 2009/8/17 22:47

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


In most cases whitespace is not important in html documents.
If not functional required (correct bugs, standard conformity, etc) please leave the tem[;ayes as they are. It will be more difficult to compare XOOPS versions and there is also a risk to introduce bugs at places where there weren't.
Don't change for changing.

Login

Who's Online

323 user(s) are online (250 user(s) are browsing Support Forums)


Members: 0


Guests: 323


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits