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 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.
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.
@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.
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
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
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.
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
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
@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
Hi Lee,
This post might set you on the right track: http://deeper.webangelo.net/2010/4/9/blog4umbraco-post-date.aspx
I used the PostDate in the end and it works fine :)
Sorry... Posted in the wrong thread :)
is working on a reply...
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.