PDA

View Full Version : Custom HTML - different for different pages?


Dilip
Dec-18-2005, 02:10 PM
Is it possible to customize the HTML by specific smugmug page? I would like to put a counter on some of the pages and perhaps otherwise customize, say, my home page different than my Family or Friends galleries' pages. Thanks!

Mike Lane
Dec-18-2005, 02:12 PM
Is it possible to customize the HTML by specific smugmug page? I would like to put a counter on some of the pages and perhaps otherwise customize, say, my home page different than my Family or Friends galleries' pages. Thanks!

Absolutely. Simply view the source and look for the body tag. You'll see something like this (only an example, it's different on different pages):

<body class="category category_Animals galleryPage gallery_123456 loggedIn">

You can use those classes and CSS to make each individual page do what you want it to do.

Dilip
Dec-18-2005, 02:28 PM
Neat. So based on the body tag, I could write a conditional expression? Is there an example I could look at? Thanks!

Mike Lane
Dec-18-2005, 05:12 PM
Neat. So based on the body tag, I could write a conditional expression? Is there an example I could look at? Thanks!

Well CSS doesn't have conditional expressions per se. But essentially what you're doing is a conditional expression I suppose. You can, however, use javascript's ability to handle conditional expressions based on these classes.

(yes javascripters, I know there's no official get element by class in javascript. There is an unofficial one though :D)