In my document library I have a number of HTML files with the calender month on them (e.g. July 2011.htm, August 2011.htm through to December 2012). I have a Content Editor webpart that displays the HTML file for the current month. At the moment I am manually changing the Content Link of the webpart every month to display the new content - is there some way of doing this automatically using script. I do not have Sharepoint Designer, and am on Sharepoint 2007
0
votes
1 Answers
0
votes
Use getMonth() method of javascript to get the current month.
http://www.w3schools.com/jsref/jsref_getmonth.asp
Once you have the month, you can append it with the location of your html file and output the link. Note that you can also put the javascript in CEWP web part:
http://sharepointsolutions.blogspot.com/2007/07/adding-javascript-to-content-editor-web.html