1

How do we apply the insert option to a folder and what ever child folder created inside this folder should have same insert option. How can I achieve this? Applying insert option on parent folder allows the parent folder alone to have the insert option.

1

You have a few options on how to achieve this:

  • create a template based on the folder template, set the standard values on this template as pleased and use this one for your folder items at the location
  • use the rules engine to add the insert option. How to this can be found at several locations already so I won't repeat it again: https://sitecore.stackexchange.com/a/15190/237

(or https://www.skillcore.net/sitecore/sitecore-insert-options-rules or https://www.pieterbrinkman.com/2011/05/02/sitecore-rules-engine-how-to-create-an-insert-option-rule/)

With the little information I have from your case, I would go for the first option though: create your own folder template and set the insert options as you please.

2
  • Actually, only the Rules Engine can achieve what OP asks
    – Mark Cassidy
    Nov 23 '21 at 9:50
  • True, but in lots of cases people make it too complex and a simple custom folder will meet the business needs as well
    – Gatogordo
    Nov 23 '21 at 11:03
0

You can use instead of the out of the box folder template, your own folder template, and give this template the desired insert option on the Standard values.

If you want to change it on an existing folder structure and use the default values is not an option, do it with PowerShell.

See https://sitecore.stackexchange.com/a/15177/112 for a similair script:

-1

There are 2 ways to implement this:

  1. In the standard value of the folder, assign Insert option so whenever you will create an item from that template Insert option will be available.
  2. You can use the PowerShell script, to get all child items for a particular parent and then assign the Insert option on a particular child.

Below is the example:

$allSitecoreFolders = get-childItem -Path "master:\content\folderpath\" -Recurse | Where-Object {$_.templatename -eq "Folder"}
foreach($folder in $allSitecoreFolders ){
    $folder.BeginEdit();
    $folder.fields["__masters"].Value="{A87A00B1-E6DB-45AB-8B54-636FEC3B5523}|{13DA436A-21B2-40AF-9926-9C8341C51EAA}"
    [void]$folder.EndEdit();
}
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.