Dynamic Modules in Sitefinity offer great possibilities for custom development and one of the most common scenarios is to relate several content types. There are some blog posts on this topic (like this one and this one) but they were written long time ago and the approaches described there are obsolete or there is an easier way to achieve the end result - having "one to one" and "one to many" relationships.
To speed up the whole process I advise you to install Sitefinity Thunder - it's a Visual Studio plugin that provides some handy features like editing Sitefinity themes or uploading your project to Azure and of course a user control that is used to select dynamic items). Just get Thunder and install it to your Sitefinity Project and then follow my video.
Let me briefly describe what is going on in the video:
- First we need to have two content types for which we are going to relate. The content types can be even in different dynamic modules
- Then field selector for dynamic items is added from thunder - it has nice UI so no codding is needed to specify which is the content type used for relations
- A new field is added to the Authors content type named Books which is "Array of GUIDs" and for interface widget we are specifying our new field control
- After that we relate several items from the content menu and display them in a frontend page using some special properties in the dynamic widgets.