Copied to clipboard

Flag this post as spam?

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


  • Lee 1123 posts 3059 karma points
    Jul 13, 2010 @ 07:57
    Lee
    0

    Programatically Creating Posts & DateFolders

    I am looking to programatically create some posts using the API, but I need to make sure the posts are kept in the DateFolders.

    Is there a method I need to invoke before I create the nodes to fire the DateFolder code?  Or do you have to actually do it manually?  As in look up the date, split it and create the separate folders etc..?

    Thanks

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jul 13, 2010 @ 08:07
    Tim Geyssens
    0

    Hey Lee,

    If you simply create a post under the blog document the datefolders should be created automatically (and the post will be moved).

    So you don't need to think about the datefolders.

    Cheers,
    TIm

  • Lee 1123 posts 3059 karma points
    Jul 13, 2010 @ 13:27
    Lee
    0

    Hey Tim

    Thanks for replying, I didn't explain properly - I need to create the datefolders based on a date different to the date of creation.  If I create the post using the API, the folder gets created with todays date (Which is cool).

    But the data I am creating is from an old site and I want to keep the created date and reflect this in the blog folders?  Any ideas on this?

    I have the createddate on the node now using the original creation date, if I could get these folders to reflect the same it would be frickin ace!  This is actually for a free package I am attempting to release today, so any help is appreciated.

  • Bijesh Tank 192 posts 419 karma points
    Jul 13, 2010 @ 13:37
    Bijesh Tank
    0

    How about the AutoFolders package? Would something like that work? Can be configured to create the folders based on custom property or default document dates http://our.umbraco.org/projects/developer-tools/autofolders

  • Matt Brailsford 2958 posts 15629 karma points MVP 7x c-trib
    Jul 13, 2010 @ 13:39
    Matt Brailsford
    0

    Hey lee,

    I'm guessing blog4umbraco only sorts on the first creation? If so i reckong you'd need to fire the sort manualy. Alternatively, like Beijesh said, you could use autofolders, event temporarily as that sorts on publish too, so you could install it, get it to reindex them all, then uninstall.

    Matt

  • Lee 1123 posts 3059 karma points
    Jul 13, 2010 @ 14:10
    Lee
    0

    @Bijesh - thanks bud, I was hoping to use the built in autofolders that come with blog4umbraco instead of relying on a third party :(

    @Matt - Ok, I'll have another think.  I need to do this on creation really, as there could be any amount of nodes - And there is already a lot of stuff going on with the package.

    Thanks for the replies though chaps

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jul 13, 2010 @ 14:27
    Tim Geyssens
    1

    Hi Lee,

    This post might set you on the right track: http://deeper.webangelo.net/2010/4/9/blog4umbraco-post-date.aspx

  • Lee 1123 posts 3059 karma points
    Jul 13, 2010 @ 17:36
    Lee
    0

    I used the PostDate in the end and it works fine :) 

  • Peter Nielsen 149 posts 206 karma points
    Jun 06, 2011 @ 09:15
    Peter Nielsen
    0

    Sorry... Posted in the wrong thread :)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies