View Full Version : how to display a front page photo
mojones
Jul-11-2005, 02:41 AM
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
<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>
Andy
Jul-11-2005, 05:23 AM
that's pretty cool!
lynnma
Jul-11-2005, 06:35 AM
That is cool.. now can you write something so that several pictures rotate through? a slide show?:D
USAIR
Jul-11-2005, 03:23 PM
:agree now that would be cool :D
Fred
Very sweet - thanks for posting about this. http://dgrin.com/images/smilies/clap.gif
mojones
Jul-12-2005, 12:45 AM
That is cool.. now can you write something so that several pictures rotate through? a slide show?:D
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..
lynnma
Jul-12-2005, 04:30 AM
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..
:D
brjphoto
Jun-21-2006, 08:58 PM
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.
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
<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>
devbobo
Jun-21-2006, 09:45 PM
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 (http://www.brjphoto.smugmug.com)
Thanks.
Hi brjphoto,
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 (http://www.dgrin.com/showthread.php?t=28348) is already written.
Otherwise, let me know and I write something a bit more robust.
Cheers,
David
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.