how to display a front page photo
mojones
Registered Users Posts: 13 Big grins
I just got an account with smugmug and I've been playing around with the available options. I wanted to display a 'front page' photo & caption on my homepage, but the options only allow a single header html block for all pages. Here's how to do it using javascript - this goes in the 'header' box on the customise page. It simply checks if the URL is that of the homepage, and inserts a photo and caption if it is. See it in action here:
http://mojones.smugmug.com
Hope this is of use/interest to someone.
mj
http://mojones.smugmug.com
Hope this is of use/interest to someone.
mj
<SCRIPT LANGUAGE="JAVASCRIPT"> <!-- var myString = location.href; if (myString=="http://mojones.smugmug.com/"){ document.writeln('<br><img src="http://mojones.smugmug.com/photos/27497329-M.jpg" width="600" height="399"> <br><H3>Edinburgh castle from Blackford hill</H3><hr>'); } //--> </SCRIPT>
0
Comments
Portfolio • Workshops • Facebook • Twitter
Fred
http://www.facebook.com/Riverbendphotos
I'll look into it.... that was actually the first bit of javascript I've every hacked together, so a little bit more study may be required..
I can't get this to work for me. Does anyone have any idea why? Nothing shows up. Just the normal header.
www.brjphoto.smugmug.com
Thanks.
hmm...this code is somewhat dodgy IMO. Are you looking for just a single photo or perhaps a slideshow ?
If you're in fact after a slideshow, a hack is already written.
Otherwise, let me know and I write something a bit more robust.
Cheers,
David
SmugMug API Developer
My Photos