Jump to content

Changing The Bgcolor & Other Bits Of Cache Pages


Tonsil

Recommended Posts

Okay, so I was noodling around with a cache listing, trying to mess with the colors on the page. I used the following snippet in the long description:

<script language="JavaScript">
mybody=document.getElementsByTagName("body").item(0);
mytable=mybody.getElementsByTagName("table").item(3);
mytable.bgColor = '#ccffcc';
mytable2=mybody.getElementsByTagName("table").item(5);
mytable2.bgColor = '#99ff99';
</SCRIPT>

and while it works in an offline version of the page, the live variant strips out the script tags. That's totally understandable... I mean, I would rather be limited in what I can do in a page and not have some gonad be able to insert code with malicious intent. However, it prompted me to ask the questions: What is considered okay as far as modding the pages? What limitations are there? If I start messing around with code, am I going to bring about the ire of the admins? Because I'm sure if I played with it long enough, I could figure out some way to mess with the page, but I don't want to be causing trouble. Also, it would be nice to know ahead of time what tags are stripped so I don't waste time trying to include them in a page design.

 

Thanks!

Link to comment

There are no "rules" per se. IMO if you plan to mess with the design of the page, do so in such a way that you do not defeat the navigation around the edges, and keep the information where it normally is. Just use basic User Interface rules so people don't get frustrated reading the page.

 

Also, keep in mind that a lot of people use GPX files which contain your html. It may not render the way you want it, or worse, make it look so bad in other formats it is unusable.

 

I acknowledge that people modify the background images but the html used to do this breaks html rules, so it is officially unsupported. However I do like the idea of adding functionality for people to apply their craft to their own pages - within reason.

Link to comment

Yeah, you're quite right. The stuff I'm trying to do, mostly simple things like changing the color of the white main content table (which looks admittedly nasty, but I realize that) aren't worth opening the door to problems. The habit of dropping another body tag into the long description to change backgrounds would make Al Gore weep, and we don't really want to see that (again). What would be nice, and this falls into the category of ideas that probably won't see light of day anytime soon but are fun to think about, is this:

 

Add in some tools to the cache creation page that will create the code for you. Allow people to set the background color of the content window, maybe the color of the main green background (although that deviates from the uniform look of the site), and allow people to upload background images. The image would then be properly linked in the actual body tag, so the html would be proper. Of course you'd have to check against morons thinking they're sly by tring to pass a bunch of script through a color code ( you go, script kiddie! *yawn*).

 

I admit, it's probably more work than it's worth. As it is, I can always approximate what I want in a nested table, and it would probably look better anyway (keeps the 'business' part of the page consistent). Thanks for the reply, though.

Link to comment

Actually, you can put in a body background tag (even though it's bad) in the cache description. What you can't use is <script language="JavaScript">. Anything dependent on that will be scraped fro the code.

 

This page has a one pixel color dot that looks like this:

 

06ed308b-902a-423e-b8d6-53aa231bae16.jpg

(do you see the orange dot?)

 

Then I added this to the cache page description:

 

<body background="{URL OF IMAGE}">

 

You can see the results.

Link to comment
The habit of dropping another body tag into the long description to change backgrounds would make Al Gore weep, and we don't really want to see that (again).

:D:blink::D:D:D:D:D:DB)B):D LOL Tonsil - thanks for making my day!

 

But seriously, to add a tad of substance to this discussion - guess I'd hafta say that for those of us who can play with the pixels, there seems to be plenty of room to do so (albeit a bit unconventional/idiosyncratic). And likewise for those who can't - there's at least a few simple tags they can employ spelled out... well, I never seem to be able to lay hands on it, but suffice that there's links to a "Quick and Dirty html..." page out there somewhere in these forums (if not hidden somewhere on the geocaching.com site?)

 

ANYWAY, all I'm saying is that while I think it's a plus to be able to liven up a cache page with a bit of color, a pic or somesuch (indeed, my newest puzzle cache depends primarily on being able to tweak a few of the page code tags), I honestly don't believe that devoting precious TPTB time to effectively create a dynamic site design interface, should be a high priority for same. Face it, most folks are here to geo C-A-C-H-E, and could care less about background pretties, etc. Just seems to me that - far better for J. and the gang to focus on site usability issues, new flavors for speedy cache searches, etc.

 

But to address Tonsil's original query - it would seem that making that elusive "Q 'n D html" page (I believe the page is actually hosted by an independent cacher) or somesuch - handily available (e.g. a link from the "hiding" page?) so folks could know just what fiddle is or is not gonna work - would be a simple welcome addition (that is to say - IF it's not already somewhere about, but I am just too blind to unearth it.)

Link to comment

Not to sound unappreciative, Markwell, but I was already aware of the 2nd body tag technique. Other folks might find it useful, though.

 

Another mod that does work is the use of style tags. You can drop CSS into the body and it will affect the page that way. For example:

<style>
<!--
body {
 background-color: red;
}
</style>

That will have a similar effect as your orange pixel, without a 2nd tag (but equally offensive style code in the body). You can likewise mess with a slew of other style tags, but it's a little tricky to isolate a single table or component thereof (that doesn't have a unique identifier) without using some script. I guess the point of my post (there was one?) was that I didn't want to cause problems by modding the page, and I would rather be legit about it. Ideally, it would be good to have some design leverage without creating bad html that might choke some browser or other systems using the gpx files.

Link to comment
Guest
This topic is now closed to further replies.
×
×
  • Create New...