Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 2:
Archived articles

 

 


simonwh
User

Nov 10, 2006, 3:52 PM

Post #1 of 8 (1630 views)
Shortcut
Archived articles Can't Post

I know that AM2 no longer archives articles but what happens if I DO want to archive articles and take them out of the articles list.

A site I'd started putting together for AM1 has a job postings category and I need these articles to be moved or deleted after a set period (eg 30 days, it'll be the same for all postings not variable)

I cannot figure out how I can make this happen.

Any suggestions?

The easiest thing I could think of was to create a hidden (unlinked in AM2 language) category and move the old items there but I need it to be automatic.

I looked at AM scripts solution for timed articles for AM1 but it doesn't suit this application.

Thankyou


Damon
Staff / Moderator


Nov 11, 2006, 10:06 PM

Post #2 of 8 (1610 views)
Shortcut
Re: [simonwh] Archived articles [In reply to] Can't Post

Hi Simon,

One thing that may be helpful is deleting multiple articles at one time on the article index page in the Article Manager interface.

Check the checkbox beside each article you want to delete, scroll to the bottom of the page and from the Advanced Commands dropdown list, select Delete Selected and click Go.

I know this isn't automatic but I wanted to still mention it as it could be a time saver for you.

--------------------------------------------------- 
Cheers
Damon Edis
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

(This post was edited by Damon on Nov 11, 2006, 10:06 PM)


simonwh
User

Nov 12, 2006, 7:31 PM

Post #3 of 8 (1596 views)
Shortcut
Re: [Damon] Archived articles [In reply to] Can't Post

Thanks.

So can I assume that from your comments there is no way of automatic archiving in AM2?


Damon
Staff / Moderator


Nov 13, 2006, 8:47 AM

Post #4 of 8 (1587 views)
Shortcut
Re: [simonwh] Archived articles [In reply to] Can't Post

Hi,

Yes, currently there is no automatic way to archive articles.

Setting an expiration date for articles is definitely on the feature request list.

--------------------------------------------------- 
Cheers
Damon Edis
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/


simonwh
User

Nov 13, 2006, 9:07 AM

Post #5 of 8 (1583 views)
Shortcut
Re: [Damon] Archived articles [In reply to] Can't Post

OK, lets try attacking this from another angle.

If I wanted to create a search query that only found articles published in the last 60 days, for instance, is that still possible in AM2?

I have a list of job postings, the client has requested that they stay visible for at least 30 days. So I am now thinking that instead if showing ALL job postings I could replace the standard headlines index of the jobs category with a search results page that only displays 'new' jobs (ie less than 60 days old)

With the Advanced Search form I have to specify a date window but it would be easier if I could search for relative dates rather than specific ones.

What do you reckon?

The site I am working on at present needs this facility and if I can't achieve it them it will not be built with AM2


Damon
Staff / Moderator


Nov 13, 2006, 10:06 AM

Post #6 of 8 (1579 views)
Shortcut
Re: [simonwh] Archived articles [In reply to] Can't Post

Hi,

I think I see what you have in mind.

Here is an example of the a search query with date range:

/search.cgi?action=search&startMon=10&startDay=13&startYear=2006&
endMon=11&endDay=13&endYear=2006&categoryNum=XX&includeSubcats=0&perpage=20&
search=Search

XX would be replaced with the actual category number for Jobs.

You could probably use javascript to update the date in the search query link with the current date and the date 30 days prior to the current date.

I'm going to look into this further and should have an update in a few days (latest Thursday) to let you know if there is a way of setting up something like this.

If you come up with something before then, let me know.

--------------------------------------------------- 
Cheers
Damon Edis
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/


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/


simonwh
User

Nov 15, 2006, 12:52 PM

Post #8 of 8 (1550 views)
Shortcut
Re: [Damon] Archived articles [In reply to] Can't Post

Great, I think that'll work.

When I get AM2 installed on my clients server I'll try it out

thanks again!