cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

setting DOCTYPE declaration

Former Member
0 Likes
1,774

I need a DOCTYPE declaration at the top of a portal component's html output in order to make some CSS features work. If you don't know what I am talking about, its a declaration of the type

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

at the top of an html page.

Does anyone know where to set this and on what level.

I noticed the html of SDN does have the DOCTYPE declaration, but our own portal doesn't seem to produce this DOCTYPE declaration.

View Entire Topic
anton_malan
Discoverer
0 Likes

Hallo Theo

I cannot answer your question about how to do it, but I rather question why you would want to.

If one excludes the doctype declaration from an html document or include an incomplete one like the declaration at sdn, one switches modern browsers to rendering the html in so-called "quirks mode". In this mode, a modern browser renders according to the non-standard layout behaviour of older browsers. Some pages may in fact rely on being rendered like that. I would not be surprised if EP relies on such layout behaviour.

If one includes a complete doctype declaration, the browser's rendering mode may be switched to a "strict" or "almost strict" mode. If you do that to pages that rely on non-standard layout behaviour, the layout will appear to be "broken".

The article that I referred to, has good advice on which doctype may be the most appropriate. When an html document does not validate, like the pages at sdn, then rather do not use any doctype.

I am not sure what CSS features are not working without a doctype declaration. If you let me know more about that, I may be able to help.

Anton

Former Member
0 Likes

Anton,

The context is an attempt to create an css based dynamic menu for the portal as a replacement for the default portal menus. I want to entire hieararhy to be visible on the client without a requirement to post back to the server to drill down into the hierarchy as the SAP delivered detailed nav does.

There is the additional requirement to have rounded corners for menu tabs, which is something I also want to achieve through CSS.

My portal component builds an unnumbered list from the portal menu structure. CSS class definitions turn this list into a horizontal dynamic menu.

The idea is inspired by examples available at the following URLs

http://www.alistapart.com/articles/horizdropdowns/

and

http://www.seoconsultants.com/css/menus/tutorial/

The current status of my test project is that the menu works in a pure HTML mockup with the DOCTYPE at the top, but not within the context of my portal component.

PS : thanks for the reference to DOCTYPE article. There is a similar one at alistapart btw which I already read and which is exaxtly the reason why I am trying to set the doctype and see if this solves my problem : http://www.alistapart.com/articles/doctype/