[RFC] Backend HTML Output Semantics/Practices

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
Post Reply
User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 941
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

[RFC] Backend HTML Output Semantics/Practices

Post by hanakin »

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.
Donations welcome via Paypal Image
User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: [RFC] Backend HTML Output Semantics/Practices

Post by naderman »

I agree we should really get rid of these.
User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 941
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: [RFC] Backend HTML Output Semantics/Practices

Post by hanakin »

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
Donations welcome via Paypal Image
User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Backend HTML Output Semantics/Practices

Post by brunoais »

I also agree. Create a ticket for this issue and place it in the OP.
User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 941
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: [RFC] Backend HTML Output Semantics/Practices

Post by hanakin »

Donations welcome via Paypal Image
Post Reply