PDA

View Full Version : body tag clarification


gblotter
Sep-11-2005, 07:25 PM
The smugmug customization screen includes a section for specifying an optional html body tag. I already have a CSS body tag specified in the stylesheet section.

Stupid Question: When would I want to specify an html body tag versus a stylesheet body tag?

Mike Lane
Sep-11-2005, 07:30 PM
The smugmug customization screen includes a section for specifying an optional html body tag. I already have a CSS body tag specified in the stylesheet section.

Stupid Question: When would I want to specify an html body tag versus a stylesheet body tag?
You could initiate scripts from the body tag. Without that you are unable to access the body tag and if you needed to initiate a script you'd be SOL.

These days what you lose is the classes associated with the body tags on the various pages (which is a lot if you ask me).

{JT}
Sep-11-2005, 07:57 PM
You can actually launch scripts without access to the body tag by using the onload command inside the script field like this:

onload = jt;

function jt() {
alert('hello;);
}


And maybe I read your second response wrong, but as far as losing the body classes such as loggedin, gallery_####, subcategory, etc. if you add your own body tag - we automatically insert the classes for you. Try it and it should work out (at least in all my test cases it did), if not let me know.


You could initiate scripts from the body tag. Without that you are unable to access the body tag and if you needed to initiate a script you'd be SOL.

These days what you lose is the classes associated with the body tags on the various pages (which is a lot if you ask me).

Mike Lane
Sep-11-2005, 08:32 PM
You can actually launch scripts without access to the body tag by using the onload command inside the script field like this:

onload = jt;

function jt() {
alert('hello;);
}


And maybe I read your second response wrong, but as far as losing the body classes such as loggedin, gallery_####, subcategory, etc. if you add your own body tag - we automatically insert the classes for you. Try it and it should work out (at least in all my test cases it did), if not let me know.
I saw from different posts that you could launch scripts from other places, but the body tag is one place that it is done sometimes though yes?

I didn't know about the latter part though. So if I put <body class="mike"> it'll turn into (for example) <body class="mike smugmug category_Object etc">? If so that's pretty rad:D

Hey, while I've got your attention and we're talking about body classes :wink... Have you guys gotten around to adding "category" (in addition to category_category name) to the appropriate body tag? That'd be handy to have.

Mike

{JT}
Sep-12-2005, 07:18 AM
Hey, while I've got your attention and we're talking about body classes :wink... Have you guys gotten around to adding "category" (in addition to category_category name) to the appropriate body tag? That'd be handy to have.


Yes this will be out shortly I hope.