PDA

View Full Version : Having accessible source code formatting in Vbulletin


fabianv
06-27-2007, 12:39 PM
Hi guys,

I thought this might spark an interesting discussion since it has been plaguing me for quite a while now.

Some might argue it is not important to have accessible source code as viewers only care about the the visual output of code but to some of us clean code formatting is essential.

After doing a couple of template modifications on my vbulletin style I noticed that the web generated modifications actually caused the formatting to get lost.

Whenever I go to "View Source" in my browser the code is shown without formatting/breaks/tab spacing.. everything is just one big inline soup mess that breaks occasionally when it hits content (ie.not tags) then continues doing the same thing.

Since vbulletin templates are database driven and can only be modified from the backend it makes formatting the code even harder.

Any thoughts on this, anyone?

Dismounted
06-28-2007, 07:02 AM
The formatting is fine at stock vBulletin, but modifications start messing it up.

fabianv
06-28-2007, 09:11 AM
The formatting is fine at stock vBulletin, but modifications start messing it up.


Well keep in mind I dont have any mods installed apart from VBSEO. Where have you heard of a forum without template modifications? Whether it is adding <h1></h2> tags to titles or removing those god awful tables.

Its impossible really to go without modifying a standard release and expect to be taken seriously..

Is there perhaps any substantial information regarding template formatting that you can perhaps add apart from what I have already said?

Dismounted
06-28-2007, 11:33 AM
I've modified the templates on my site quite a bit to get it how I want and the source looks fine.

fabianv
06-28-2007, 01:36 PM
I've modified the templates on my site quite a bit to get it how I want and the source looks fine.


Interesting.. I wonder if it might have anything to do with saving my index.php or globals.php from notepad or something. Could maybe cause formatting issues?

anyone?

Princeton
06-29-2007, 01:39 AM
I find it hard to understand what it is that you are looking for.

Can you provide a screenshot as to what your problem is?

ssslippy
06-29-2007, 02:38 AM
Vbseo probally removes all spacing etc to reduce page size.

Dismounted
06-29-2007, 06:21 AM
Well there's probably your problem.

fabianv
06-29-2007, 07:53 AM
I find it hard to understand what it is that you are looking for.

Can you provide a screenshot as to what your problem is?

Hi there Princeton, I dont have a screenshot with me at the moment but I can illustrate it for you


It spews out like this
<div id="maincontainer"> <div id="header"> <div id="logo">
text
</div></div></div>
instead of this



<div id="maincontainer">
<div id="header">
<div id="logo">
text
</div>
</div>
</div>




Vbseo probally removes all spacing etc to reduce page size.

I'm not so sure whether spacing reduces page size or whether VBSEO is responsible for this BUT I will send in a ticket asking them this question.


Well there's probably your problem.

Lets hope and see, will report back when I find a solution.



Floris on vbulletin.com says

"
I use textmate to write my templates, mysql, php, etc. and when i use tabs and spaces, and copy it all to vb code, and eventually gets rendered, it shows just fine. Not sure what else to say about this. I sense this is just how the browser renders it."

My responses to that is that its definetely not how the browser renders the source code as it looks the same on multiple browsers.


Hope I figure out whats going on

Dismounted
06-29-2007, 09:36 AM
vBulletin changes the properties around in the tags, so they're in a different order. It's what happens to me anyway.

fabianv
06-29-2007, 09:42 AM
From VBSEO

That is a feature of vBSEO if you don't want it enable please disable Cleanup Html Code setting within vBSEO Control Panel

HTML CLEANUP -

Select 'Yes' to remove unnecessary whitespace characters and HTML comments from the source code of your forum pages. This increases the C2C (Content to Code) ratio and reduces page sizes, resulting in a net performance increase and reduction in bandwidth required.

NOTE: If comments (or HTML tags) within your pages are not closed correctly with their corresponding end tags, then this option could cause your pages to display incorrectly. Be sure that your templates contain error free HTML tags and code.


Problem solved