Search code examples
sitecoresitecore7bucket

Item to be bucketed according to a date field when created


I have created a content item at /sitecore/Home/FootballFever/Articles and have given insert option so that we can add only items of templates "Article".As of now,these article items are bucketable according to a field created date.

Now, i have insert option "Add Article" and "Insert from Template" buttons in the Home ribbon "Insert" block. When i create an item through "Insert from Template", the item automatically gets added in respective bucket with path as created date. for example if the item has created date is "7/21/2014" then path will be "/Articles/2014/7/21/ ".

But when i click on "Add Article", the item gets added in /Articles and i have to Sync everytime to get it to correct path. How can I have the same behavior as that of "Insert from Template" but with path having Release date which is a field of template "Article"?


Solution

  • Please make sure that Article template has Bucketable field checked in its Standard values (for Article template).

    If not, when you add a new item into buckets folder, newly added item itself is not bucketable, unlike the rest already existing items from the same bucket folder.

    I have just made a proof of concept on my sandbox environment and can confirm that in case you add a new item with Bucketable checked by Standard values - it comes into a bucket straight away and you do not need to perform Sync.

    Hope this helps.

    UPDATE: I have written a blog post specially to cover your question,with comprehensive description.

    http://blog.martinmiles.net/post/understanding-buckets-adding-new-items-to-buckets-correctly