Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 15, 2011 @ 08:54
    Fuji Kusaka
    0

    Archiving news items with a Boolean

    Hi all,

    I have a client of  mine who has a News section, upcoming and past news (archives). So what he wants is to have 2 seperate folders with the following structure

    News
    1. Upcomning
    2. Archives News

    Now the idea is to be able to move a Content Node from Upcomming News to Archives News by using a dropDown True/False which will allow the user to archive the news and at same this node will move to the Archives News folder. 

    Anyone can point out how to achieve this instead of using the traditional move to folderin umbraco.

    //fuji

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Sep 15, 2011 @ 09:03
    Hendy Racher
    0

    Hi Fuji,

    How about an event handler that on save will check the property value and move it to the appropriate folder ?

    HTH,

    Hendy

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Sep 15, 2011 @ 09:08
    Richard Soeteman
    0

    Hi Fuji,

    Checkout demo 2 of the event samples I wrote a while back.Almost what you need I think.

    Cheers,

    Richard

     

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 15, 2011 @ 09:18
    Fuji Kusaka
    0

    @Hendy

    The Auto archive news  in Example 2 seems to be the right one. But thing is that the client do not have an expiry date for the Items.

    @Richard

    The link you sent is not working.Is it the link Hendy sent?

    Thanks

    //fuji

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Sep 15, 2011 @ 09:28
    Richard Soeteman
    0

    Hi Fuji, yes the same link only to the wiki. sorry thought it only contained an overview. But you only need to change the date expire functionality to act on the value of the archived field on your document type and then it should work

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 15, 2011 @ 11:13
    Fuji Kusaka
    0

    Thanks Richard,

    I downloaded the zip file, is there any documentation to this?So i just need to change the way the date expire functionality will work, in my case change the alias and make sure when it returns to 1 the node will go under the Archieve news folder.

     

    //fuji

     

  • Jigs 40 posts 63 karma points
    Sep 20, 2011 @ 02:46
    Jigs
    0

    Hi Fuji,

    I have working solution for AutoArchive, which can archive your node from upcoming to archive news .... if you want to use it just change the alias of docunment type and property alias in this class file also change the node id of your archive folder and original folder. it will give you functionality of auto move to archive and if you want to move back to original folder agian when you click the save button ...... 

    Here is the attached code :

     This solution is based on the example available on the Umbraco wiki... thankx to writer

    Cheers,

    Jigs

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 20, 2011 @ 05:30
    Fuji Kusaka
    0

    Hi Jigs,

    Thanks for the help, I'll give this a try and will let you know, i also like Richards Method.

    Cheers

    //fuji

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Sep 20, 2011 @ 08:00
    Richard Soeteman
    0

    Hi Fuji,

    The Example Jigs used does pretty much the same as my example. Sorry for the late reply, kinda snowed under.

    Thanks,

    Richard

  • Jigs 40 posts 63 karma points
    Sep 20, 2011 @ 08:35
    Jigs
    1

    Hi Richard,

    I think i used your example when i wrote this code ,,,, Thanks for such a good example but i got the problem when i pressed the save button using your example so ....it doesnt move the node to archive .... actualy i need to Click save button two times to move it to archive folder...... and then i twisted the code litl bit using doc instead of using sender directly ...and now its working well .... it move the node in single click .... but anyway great example and great help to other users by your example. Much appriciated.

    Cheers,

    Jigs

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 20, 2011 @ 11:41
    Fuji Kusaka
    0

    Hi Jigs,

    I gave this a try but nothing is happening. Am not sure of doing the propert way thought. What i did i added your code in my template instead wrapped in a <script language ="C#">

     

  • Jigs 40 posts 63 karma points
    Sep 21, 2011 @ 02:18
    Jigs
    0

    Hi Fuji,

    i will tell you the step by step what you need to do

    1. make a new visual Studio project --- give name
    2. add a new item --- class give a name AutoMoveToArchive
    3. now copy the code i gave you to the class file
    4. build the project
    5. copy the assembly to your umbraco bin folder
    6. and refresh the catch by touching the web.config
    7. now all done , go to archive folder and give it a try ...

    Cheers,

    Jigs

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 21, 2011 @ 07:40
    Fuji Kusaka
    0

    Hi Jigs,

     

    Thanks for the reply again, i will work this out later. One question, how did you tell you node that this page is an Archive? Am using the a true/false select dropdown with a document alias archive. Are you using the same method?

    //fuji

  • Jigs 40 posts 63 karma points
    Sep 21, 2011 @ 07:54
    Jigs
    0

    Hi Fuji,

    I used a --- property in my document type ---- boolean ---- when i designed it called ---- Archive ---- which is the check box type

    ok so when you click on Archive and click SAVE button it will move this node to Archive folder and again .... in archive folder if you unchecked it and click save button it will move back to original folder ....

    It works fine for me and I think pritty WELL

    Hope it will help you

    Cheers,

    Jigs

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 21, 2011 @ 08:00
    Fuji Kusaka
    0

    Ok, so am doing the pretty much the same thing. I will let you know, but thanks for the help.

  • Jigs 40 posts 63 karma points
    Sep 21, 2011 @ 08:11
    Jigs
    0

    ok no worry,

    If you find it as solution ...... give hive five .....

    Thanks

    Jigs

Please Sign in or register to post replies

Write your reply to:

Draft