dotCMS - Open Source Content Management System, Ondemand CMS, and Professional Support

Document Search

Article Information

Since Version: 1.6.5
Tags: relating structures relationship
Updated: 9/17/2008 5:42:45 PM
By: Dean Gonzalez
Doc id: 144896
Print Page: Export to PDF

Relating Structures

Structure-Relationships

A dotCMS Content Architect or Webmaster can add Relationships between Structures when the two Structures in question need a mandatory relationship between eachother or when the one Contentlet will be used in dynamic pulls to display the other.  For instance, a Player Structure might need a mandatory relationship to a Team Structure so that no player can be entered into the dotCMS without being related to a Team.  On this documentation site, Documentation is related to Screencasts so that they will pull dynamically on the appropriate pages by their relationship.

To add a Relationship between Structures, first mouse over the Structures Tab in the dotCMS menu and click on "Relationships" on the drop down list.  The Structures Relationships portlet displays information about the established relationships on the website.  Click on the "add new relationship" button to add a new Relationship between two Structures.

Click on Add New Relationship

Step One: In the Add/Edit Relationship window, choose which Structure will be the "Parent Structure" and which will be the "Child Structure".  In the example of "Team" and "Player" Structures, the Team would be the parent and the Player the child because a players are subsets of a team.  In the example of the "Documentation" to "Screencast" Structures, the Documentation Structure becomes the "parent" because one or more Screencast Contentlets will be created in support of each piece of Documentation.

Step Two: Type the "Parent Relation Name" and the "Child Relation Name" whose combination becomes the title of the relationship, in this case, "DocParent-ChildScreencast"

New Relationship

Step Three: Choose a "Relation" - either "One to Many" or "Many to Many" to limit how many pieces of Content can be related to eachother on either side of the Relationship.  Ex: In the case of a "TeamParent-ChildPlayer" relationship a "One to Many" Relation could be used if each player where allowed to belong to only one Team at a time.  A "Many to Many" Relation would allow a Player to belong to (be related to), any number of Teams.

Step Four: Choose the "Is a Parent Required" checkbox to force a Relation to a piece of Parent Content when a piece of Child Content is created.  Choose the "Is a Child Required" checkbox to force a Child Relationship when Parent Content is created.

Step Five: Save the New Relationship.

After creating the relationship between Structures, Content created on either Structure can be related to one another.  For more information on creating related content, please see the documentation section on Adding Content Relationships.



Post a Comment


Add Comments

   

 
Post