You are able to change the format of the default bucketing folder structure uising the following setting:
<setting name="BucketConfiguration.BucketFolderPath" value="yyyy\/MM\/dd\/HH\/mm"/>
Note that this is still based on the item creation date though.
It is also possible to utilise the Sitecore Rules Engine to determine the folder structure, updating the rules on /sitecore/system/Settings/Buckets/Item Buckets Settings
in the content tree.
Out of the box the following rules are available:
The first rule is pretty much the same as the default naming using config settings, but it does allow you to set a different format per bucket folder. The other 2 rules use the item ID or name and then create nested folders based on that.
If none of rules meet your requirements then it is possible to create a custom rule and utlise that instead. For example, to create the folder based on the user creating the item and the year you could use:
public class UserBasedPath<T> : RuleAction where T : BucketingRuleContext
{
public override void Apply(T ruleContext)
{
if (Sitecore.Context.Data != null && Sitecore.Context.Data.User != null)
{
ruleContext.ResolvedPath =
Sitecore.Context.Data.User.LocalName + "/" + DateTime.Now.Year;
}
}
}
You will need to register the rule under /sitecore/system/Settings/Rules/Definitions/Elements/Bucketing
and set the Text
and Type
fields to match your rules and the it will be available for use in the Rule Set Editor.