adding rss and atom buttons to your custom footer

{JT}{JT} Registered Users Posts: 1,016 Major grins
edited May 31, 2005 in SmugMug Support
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>
Sign In or Register to comment.