Zen Cart Logo
Forums / Customization from the Admin / Doctype for Admin

Doctype for Admin

Views: 2,822

Results 1 to 11 of 11
24 Nov 2012, 5:14 PM
#1
trvlfox avatar

trvlfox

Zen Follower

Join Date:
Aug 2007
Location:
Fort Worth, Texas, United States
Posts:
156
Plugin Contributions:
0

Doctype for Admin

On my ZC1.5.0 shop, I noticed that my admin doctype is different from my main site. In admin, it uses <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">which causes IE9 to go in quirk mode. Very annoying.

My main shop site is using

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Is there a reason for this? Can I go ahead an update my files to match my shop? I thought I would ask before going through all the files. UGH :blink:

25 Nov 2012, 12:01 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Doctype for Admin

Quit using IE and get with a more compliant browser

25 Nov 2012, 2:35 AM
#3
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Doctype for Admin

TrvlFox:

On my ZC1.5.0 shop, I noticed that my admin doctype is different from my main site. In admin, it uses <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">which causes IE9 to go in quirk mode. Very annoying.

I'm curious. Why does IE being in Quirks mode cause you to be very annoyed. (IE doesn't exist on Macs, so I can't just look for myself.)

As for the admin doctype, the admin code is quite old. Revising it now just to make it XHTML compliant would be a very annoying task.

Rob

25 Nov 2012, 6:07 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Doctype for Admin

I don't recall anybody else complaining that it was triggering any problems in IE9. Not sure what your specific issues are.
The admin doctype is completely unrelated to your catalog/storefront doctype.

While the doctype is changing to "html" for HTML5 support in v1.6.0, if you blindly go and change it without ensuring all other dependencies are addressed, you might create yourself more problems.

You REALLY should figure out what exactly is the real root of the problem that's causing the annoyance you mentioned, rather than jumping to change a doctype that nobody else is reporting any problems about.

25 Nov 2012, 10:45 AM
#5
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,872
Plugin Contributions:
7

Re: Doctype for Admin

There's no reason why it has to match the shop doctype. The admin code is html not xhtml anyway.

Many moons ago I changed it to a valid doctype (html not xhtml) with no problems.

Why change it at all? Well when I start to hack about in admin page for my own ends, first I fix the existing html errors so I can easily correct the new ones I introduce and the html checkers I use need a valid doctype to work with.

Previously I never saw anything broken as a result of quirks mode, but I only use IE for a final check after doing dev work with FFox.

Unless you can't actually do something in the admin as a result, what does it matter?

23 Jan 2013, 8:29 AM
#6
jarkko avatar

jarkko

New Zenner

Join Date:
Jan 2013
Posts:
7
Plugin Contributions:
0

Re: Doctype for Admin

DrByte:

You REALLY should figure out what exactly is the real root of the problem that's causing the annoyance you mentioned, rather than jumping to change a doctype that nobody else is reporting any problems about.

I report problems. Quirks mode causes massive problems in modern web development, for example the flashcanvas doesn't work in quirks mode, resulting that you can't develop anything with canvas-elements which would support any IE-browsers. And the problem REALLY is that Zen Cart admin sends doctype that causes all browsers to go to quirks mode.

I would recommend doctype for Zen Cart to be used with dtd, which doesn't force browsers to quirks mode:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Or perhaps even more bulletproof would be Strict:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
23 Jan 2013, 8:40 AM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Doctype for Admin

Jarkko:

I report problems. And the problem REALLY is that Zen Cart admin sends doctype that causes all browsers to go to quirks mode.

I have never experienced this in ANY browser, so the problem you are reporting may be of your own making. I have installed nearly 300 zencart sites, across versions starting from 1.2.5 back in 2004.

Additionally, I have progressed through all versions of MSIE (though as Kobra concurs, I seldom if ever use it because it is a hugely problematic browser for professional developers. I just do quick tests in MSIE to make sure everything works for my clients - and as I said, in the last 9 years I have NEVER had a "quirks" issue with it when accessing admin areas in MSIE.

Arbitrarily changing the doctype is not advised...

23 Jan 2013, 9:16 AM
#8
jarkko avatar

jarkko

New Zenner

Join Date:
Jan 2013
Posts:
7
Plugin Contributions:
0

Re: Doctype for Admin

schoolboy:

I have never experienced this in ANY browser, so the problem you are reporting may be of your own making. I have installed nearly 300 zencart sites, across versions starting from 1.2.5 back in 2004.

Additionally, I have progressed through all versions of MSIE (though as Kobra concurs, I seldom if ever use it because it is a hugely problematic browser for professional developers. I just do quick tests in MSIE to make sure everything works for my clients - and as I said, in the last 9 years I have NEVER had a "quirks" issue with it when accessing admin areas in MSIE.

Arbitrarily changing the doctype is not advised...

Have you developed any modules for admin area that uses canvas for example, or customized any part of admin area accordingly? Sure, it works out of the box, but quirks mode really isn't developer friendly if you really want to develop modern web pages/applications.

23 Jan 2013, 9:29 AM
#9
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Doctype for Admin

Jarkko:

Have you developed any modules for admin area that uses canvas for example, or customized any part of admin area accordingly? Sure, it works out of the box, but quirks mode really isn't developer friendly if you really want to develop modern web pages/applications.

That's the point I'm making... the "problem" seems to be occurring because of customisations - not because of problems with the core code.

If customisations are made to any aspect of any program, then there is a risk of incompatibility.

Here's a typical scenario I encounter daily...

When I complete a zencart site, just PRIOR to handover to the client, I run it through W3 validators. I try to get it 100% compliant.

Within a week - and after clients start adding their own stuff - usually home page text, or product descriptions - I run it through W3 again and a whole host of errors and warnings can appear - all created by my clients not knowing basic HTML protocols. They use the CK-editor, and have no understanding of the underlying generated HTML, so they do not know that a lot of what they are doing is not compliant.

The point is that ANY customisation can invalidate the integrity of the HTML.

So... if a developer is doing any custom work, then it is up to that developer to ensure compliance.

23 Jan 2013, 11:27 AM
#10
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,872
Plugin Contributions:
7

Re: Doctype for Admin

well I've been using this in the admin for a very long time:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

as I stated above, for no other reason than to help me validate MY customisations in the admin. It certainly is not necessary to "fix" any inherent problems, in my experience. There are inherent validation errors in the admin html but nothing that breaks anything, it is mostly legacy code and due for big changes anyway at the appropriate time...

23 Jan 2013, 8:14 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Doctype for Admin

Jarkko:

for example the flashcanvas doesn't work in quirks mode, resulting that you can't develop anything with canvas-elements which would support any IE-browsers.
Yes, that would be a problem.

You can change it. But you'll have to touch a lot of files to make it happen, depending on which pages you intend to add canvas elements for. And test that you've not broken anything else that might have been depending on the original doctype.

As I said before, v1.6.0 is being updated to use HTML5 ... and unfortunately it's not a simple matter of touching just a couple files.
In the meantime, make whatever changes you need for yourself, and be sure to test that you've not broken anything else in the process.