2

I have a content tree folder with hundreds of child items. Is there a way to have a profile card assigned to all child items without manually assigning them the card?

4
  • 1
    Just to be clear you don’t assign a pattern card to a item. You assign a profile card. The pattern card is part of the scoring that happens at run time. – Chris Auer Oct 4 '17 at 19:30
  • 1
    See my answer here if you want to apply profile cards at run time and never on the item itself. sitecore.stackexchange.com/questions/7847/… – Chris Auer Oct 4 '17 at 19:49
  • Profile card- my mistake. – Al Corey Oct 4 '17 at 20:09
  • 4
    I discovered that you can assign a profile card to the standard_value of a template and all items using that template inherit the profile card. problem solved. – Al Corey Oct 4 '17 at 20:10
1

As mentioned in the comments, there are two solutions:

Solution 1: Standard Values

Assuming the contents of your folder all share a Data Template (or inherit from one) you can assign the profile card to the Standard Values of the appropriate Data Template, and now all your folder content will automatically have it on creation (and retroactively for existing Items provided they don't have any profile cards assigned already).

Solution 2: Event Handler

If the contents of a given folder are of mixed Template types, you need to get clever. You can create an Item Created or Item Saved rule that does the following:

  • Checks to see if the new Item's ancestry includes the folder that "designates" Items that should have a specific profile card.
  • If true, executes a custom Rule Action to add the profile card to the new/saved Item.

When creating a custom Rule Action, you can add the Profile Card ID as a parameter, so that you can apply this rule action to other folders, and supply references to other Profile Cards.

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.