i want to set field of Created From for an item in sitecore which appeared in the quick info section , how can i do that via sitecore or using powershell script?
2 Answers
The only time that I have seen the Created from
field be anything other than [unknown] is when an item has been created from a branch template.
Therefore I suggest you experiment with creating items from branch template: Sitecore: Branch Templates
In short, navigate to /sitecore/templates/Branches
:
Create branch template => you will be asked to choose an existing template to create from.
You can then add multiple items under that branch template, creating a skeleton of items, under the main item.
Each time you create something new from that branch, it will recreate all items each time.
Now navigate to your content tree and and create from template. But select your new branch template.
Now when you view the item, it will say Created from: [name of your branch template]
You can use BranchId
property of an item like that:
item.Editing.BeginEdit();
item.BranchId = idOfSomeBranchItem;
item.Editing.EndEdit();
Be aware that idOfSomeBranchItem
should be an ID of a branch template, so an item which is of a /sitecore/templates/System/Branches/Branch
template.