|
|
Rank: Devotee
Joined: 9/12/2007 Posts: 58 Location: Honoluu, HI
|
Hello,
How would you go about an create a schedule task in umbraco using C#? I plan on creating a news archive page that pulls all the news items from the news page and moves it to News archive page once the new year begins.
Can I use an action handler to do this task?
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 597 Location: Bad Homburg, Germany
|
No, an action handler reacts on actions done in the umbraco backend. So they will only perform if you, eg publish a node. One possibillity is a scheduled task defined in /config/umbracoSettings.config where you can call an url scheduled. Code: <scheduledTasks> <!-- add tasks that should be called with an interval (seconds) --> <!-- <task log="true" alias="test60" interval="60" url="http://localhost/umbraco/test.aspx"/>--> </scheduledTasks>
This was for calling an aspx from umbraco to keep umbraco live, but you can call your own node with your own ascx or you can call your own webservice. Within this webservice you can check the date time and can perfomr the actions you want. hth, Thomas
• 2007/2008 MVP • www.thoehler.com • Bad Homburg, Germany
|
|
Rank: Devotee
Joined: 9/12/2007 Posts: 58 Location: Honoluu, HI
|
Thanks thomas.
I will try out your suggestions and post what I come up with :!:
|
|
 Rank: Administration
Joined: 7/25/2006 Posts: 415 Location: vipperoed, denmark
|
Hj John, Do you actually have to move the old news? In my opinion it's just another way of looking at the news and could be solved by sorting and filtering with some xslt on whatever news date you're using. kindly, Jesper webbureau jesper.com doing webdesign / development / umbraco implementations / 2007&2008 MVP
|
|
 Rank: Fanatic
Joined: 7/25/2006 Posts: 424 Location: Silkeborg, Denmark
|
Moving pages, and thus changing their URL, is a very bad thing to do when it comes to SEO and Google. - If fx. Google manages to index your news items before they are moved to the archive, once they are moved Google will still be directing traffic to those (no longer existing) pages for a while until it discovers they are gone. - The pages will loose any Google (pagerank) value that they have allready build up when they are moved. - Since they are moved and the URL changes, it will be hard for people to bookmark or link to a new item. - Google might think that both pages (the news item and the archived one) exist at the same time and then mark the newest one as "duplicate content" and never index it. So you'll run the risk of your archive never being indexed på Google. So as Jesper says, why not just post all news items under the same node and let them stay there? And then just apply a little sorting/filtering where you need to just display the top? /SoerenS Brug for råd til hvordan du driver en god webshop? / Need advice on how to run an effective webshop?
|
|
Rank: Devotee
Joined: 9/12/2007 Posts: 58 Location: Honoluu, HI
|
Thank you jesper and soeren.
I will have to redesign my page. Thanks for the valuable advice :)
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 649 Location: Preston, UK
|
John,
I usually do news archive thing by displaying on news page first 10 news items then creating another page called news archive which lists all news items as paginated list ordered by date descending. You could do something similar but on your main news page say list all news items for the current year and on your news archive page list all not including this year.
Regards
Ismail
Level 2 certified. If it aint broke dont fix.
|
|
Rank: Devotee
Joined: 9/12/2007 Posts: 58 Location: Honoluu, HI
|
Hey Ismail,
Do you have xslt samples no how you created the paginated list?
Thanks,
John:D
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 649 Location: Preston, UK
|
John, Take a look at Doug's excellent xslt search package that has got pagination. Regards Ismail
Level 2 certified. If it aint broke dont fix.
|
|
|
Guest |