
Damon
Staff
/ Moderator

Nov 13, 2006, 3:27 PM
Post #7 of 8
(1567 views)
Shortcut
|
|
Re: [simonwh] Archived articles
[In reply to]
|
Can't Post
|
|
Hi again, Good news! After chatting with Mike about what you were looking for, he had some JavaScript code that just needed to be modified a little to get the results you are after. This was really helpful for me as I'm not a JavaScript coder. :) The code looks at your systems current date and the date 30 days prior to the current date and output these values into the search query string. In the categoryMenu.html template (/templates/categoryMenus/categoryMenu.html), replace this: <a href="$published.categoryIndex.url$">$category.name$</a> with this [templateIf : $category.name$ eq 'Jobs'] <script type="text/javascript"> var myDate=new Date() var backDate=new Date() backDate.setDate(backDate.getDate()-60) var currentMonth= myDate.getMonth() +1; var backMonth= backDate.getMonth() +1; document.write('<a href="$settings.searchurl$?action=search&categoryNum=19&startMon=' + backMonth + '&startDay=' + backDate.getDate() + '&startYear=' + backDate.getFullYear() + '&endMon=' +currentMonth + '&endDay=' + myDate.getDate() + '&endYear=' + myDate.getFullYear() + '">$category.name:javascriptSafe$</a>'); </script> [/templateIf] [templateIf : $category.name$ ne 'Jobs'] <a href="$published.categoryIndex.url$">$category.name$</a> [/templateIf] Using the templateif statements, the javascript is only include with the Jobs category link. All the other catgegories get a regular link. Currently that date range is set for 60 days. Save the template, upload it, log in to Article Manager and re-publish the Category Menus and Global Menu. That's it. Let me know how that works for you and if you have any questions. --------------------------------------------------- Cheers Damon Edis interactivetools.com Hire me! Save time by getting our experts to help with your project. http://www.interactivetools.com/consulting/
|