phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

[RFC] Backend HTML Output Semantics/Practices

Publish your own request for comments or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.1/Ascraeus and 3.2/Arsia.

[RFC] Backend HTML Output Semantics/Practices

Postby hanakin » Thu Mar 10, 2011 4:55 pm

PROPOSAL

There are several places where through the use of template variables the backend outputs HTML code blocks in the template files. This is in bad practices for several reasons. Most notably it is generating bad semantic code.

Reasoning:
  1. Generation of bad semantic code
  2. Progression limits HTML and CSS progression, as time goes on and the languages change the back-end would have to be changed to reflect this.
  3. Restricts theme authors in the development process causing further complexity to an already complex and lengthy process.
  4. Increases the amount of styling required to match the design based on the poor semantics and rigid output.

I have assembled a list of these changes here, some of which are simple others more possibly complex. If anyone notices any other possible changes post them here and I will update this post. I will also be updating this post as I myself find more of these changes.

The LIST:

  1. index.html :arrow: {LOGGED_IN_USER_LIST} - Should be rewritten separating the label of Registered users: out as a separate variable and the content should then be a comma delimited block of text like how the legend works directly under it.
  2. posting-editor.html :arrow: {BBCODE_STATUS}, {IMG_STATUS}, {FLASH_STATUS}, {URL_STATUS}, {SMILIES_STATUS} - needs restructured to reflect the semantic structure. EXP: <dt>BBCODE</dt> <dd>ON</dd> the "is" should be added via css since you could infact just use a colon.
  3. {PAGINATION} - Should be rewritten to export a link or span containing for each page with in an order list, rather than the mess it exports currently. Personally i would prefer having it just export span or anchor and use a loop with in the html to call it this way the classes used for styling it would be completely up to the individual coding the template. Either that or we need dynamic variables similar to what wordpress uses for it category list function where it can accept parameters.
  4. viewtopic_body.html :arrow: {postrow.EDITED_MESSAGE} - Needs separated into 2 variables the author info can be pulled from the postrow already, but the rest needs split into the date and the message to reflect proper semantics.

    EXP of how it should be implemented
    Code: Select all
    <cite>
       <span>{L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong> on <span class="time">{postrow.EDITED_DATE}</span>{postrow.EDITED_DATE}</span>
    </cite>

    EXP of Rendered code
    Code: Select all
    <cite>
       <span>Last edited by <strong>Username</strong> on <span class="time">Fri Jan 01, 2010 6:21 pm</span>, edited 2 times in total.</span>
    </cite>

  5. Images - All template variables containing images should be replaced with the text used for the alt tags for said images and the images themselves should be handled through css IE {postrow.U_MINI_POST} should be <a class="post-icon" href="{postrow.U_MINI_POST}">{postrow.L_MINI_POST}</a> or something like that the anchor tag needs to be hand written for maximum flexability.

    Other variables that would fall under this are

    {UNAPPROVED_IMG} :arrow: this should be replaced with a variable containing the alt text in case css is disabled or for blind users
    {REPORTED_IMG} :arrow: this should be replaced with a variable containing the alt text in case css is disabled or for blind users

  6. Minor - others that might be fine but as common practice its still a bad idea

    {S_MARK_OPTIONS} :arrow: outputs an option tag with id and text, Id doeas not need to be dynamic just text
    {S_MOVE_MARKED_OPTIONS}:arrow: outputs an option tag with id and text, Id doeas not need to be dynamic just text
That is all I can think of for now I will be updating this as I find more.
Last edited by hanakin on Wed Feb 15, 2012 10:20 am, edited 3 times in total.
hanakin
Registered User
 
Posts: 176
Joined: Sat Dec 25, 2010 9:02 pm

Re: [RFC] Backend HTML Output Semantics/Practices

Postby naderman » Wed Apr 20, 2011 12:35 pm

I agree we should really get rid of these.
www.naderman.de
Move your forum to Forumatic - we'll take care of maintenance & spam
User avatar
naderman
Development Team Leader
Development Team Leader
 
Posts: 1650
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany

Re: [RFC] Backend HTML Output Semantics/Practices

Postby hanakin » Mon Feb 13, 2012 7:30 am

bump have been away for some time but this is still an issue i believe I saw a post from Arty to fix one of these but here is the list at least
hanakin
Registered User
 
Posts: 176
Joined: Sat Dec 25, 2010 9:02 pm

Re: [RFC] Backend HTML Output Semantics/Practices

Postby brunoais » Tue Feb 14, 2012 3:22 pm

I also agree. Create a ticket for this issue and place it in the OP.
brunoais
Registered User
 
Posts: 627
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Backend HTML Output Semantics/Practices

Postby hanakin » Wed Feb 15, 2012 10:01 am

hanakin
Registered User
 
Posts: 176
Joined: Sat Dec 25, 2010 9:02 pm


Return to [3.x] RFCs

Who is online

Users browsing this forum: No registered users and 8 guests