How to associate a taxonomy to a schema member and add Conditional for an Option List

Prerequisite: Sitecore Content Hub Sandbox v 4.1.1

Inline with the previous blog, this blog article covers details of how to add a taxonomy member to a schema definition and toggle visibility of an option list in the schema:

1. Choose your entity and for that entity, add a new member of type taxonomy:

Create a new member and select taxonomy this time:


2. Next, associate this member to a taxonomy definition:


3. As you select the cardinality, you should be able to understand what is related to what, in this case, the testschema entity is linked to mylatesttaxonomy entity

4. If you switch over to the advanced tab, you can notice that this relation is automatically classified as a taxonomy relation, leave it as-is:



5. Save the member and click  apply changes to get rid of unsaved changes tag in the top right corner just near the button:


You can also notice and understand the parent-child relationship here - testschema is child of mylatesttaxonomy -  common question in the certification exam. Usually the name that appears first is the parent followed by the child. For instance, in AssetTypetoAsset, Asset Type is parent of Asset.

6. Now, let's add an option list property and toggle its visibility based on selection of a specific item in the taxonomy member. Here is the new option list member, note that this is a member that points to the original option list definition similar to how we associated a taxonomy member to a taxonomy definition:


7. In the conditionals, I should be able to see the taxonomy member:


8. Should be able to select the taxonomy item that should satisfy the conditional so that the option list can be made visible:


9. This is how my conditional looks after the selection:



10. Save and return to the schema defintion, press apply changes button and refresh the page to see the new conditional reflected: 


11. Now, as ever, create an entity to check if everything looks good:




12. On selection of relevant taxonomy item, the option list is visible: 


13. Able to save my new entity and see it in the entity detail page: 
 

14. List of entities: 



So, here is the summary of steps:

a. Create a taxonomy with items
b. Choose a schema where this taxonomy must be associated
c. Create a member with the associated taxonomy in the entity schema
d. Next, create option list member that must be toggled visibility
e. Also, the member field in step d must have an associated option list
f. In the Conditional for the member field above, reference the taxonomy member created in step c and choose an item for visibility of the taxonomy member


Comments

Popular Posts