{JT}
May-31-2005, 09:31 AM
Someone emailed helpdesk asking for a way to put the RSS buttons back on his custom footer, I came up with some javascript that can do that:
Put this in the javascript box:
function findFeed(feedType, feedImage) {
linkTags = document.getElementsByTagName("link");
for (i = 0; i < linkTags.length; i++) {
if (linkTags[i].type == feedType) {
document.write('<a href="'+linkTags[i].href+'"><img src="http://www.smugmug.com/img/'+feedImage+'.gif" border="0"></a>');
}
}
}
Then, depending on if you want RSS, ATOM or both; use this code in your layout:
<script type="text/javascript"> findFeed("application/atom+xml","atom"); </script>
<script type="text/javascript"> findFeed("application/rss+xml","rss"); </script>
Put this in the javascript box:
function findFeed(feedType, feedImage) {
linkTags = document.getElementsByTagName("link");
for (i = 0; i < linkTags.length; i++) {
if (linkTags[i].type == feedType) {
document.write('<a href="'+linkTags[i].href+'"><img src="http://www.smugmug.com/img/'+feedImage+'.gif" border="0"></a>');
}
}
}
Then, depending on if you want RSS, ATOM or both; use this code in your layout:
<script type="text/javascript"> findFeed("application/atom+xml","atom"); </script>
<script type="text/javascript"> findFeed("application/rss+xml","rss"); </script>