More in this section

Forums / Developing with Sitefinity / Dynamic Content Relationships

Dynamic Content Relationships

3 posts, 0 answered
  1. Brian
    Brian avatar
    8 posts
    02 Aug 2014
    28 Aug 2014
    Link to this post
    Imagine the scenario whereby I have a dynamic module that has types 'A' and 'B' and A has a related data field to items of type B. In code, I can easily get the related items from A by calling 'GetRelatedItems'. However, in code I would like to get the items of type A that are related to an instance of B. The only way I can see to do this would be to get all items of type 'A', get their related items of type 'B' and check whether any of them are the same as my current instance of B. This seems very expensive. Is there anyway to get the parents of a child item?
  2. Victor
    Victor avatar
    94 posts
    15 Jun 2011
    28 Aug 2014
    Link to this post

    I would also like some clarification on this.  Right now, I'm using SQL queries and Domain Models, but it would be great to use the API, especially for localization where direct SQL isn't really a good option.

  3. Grisha 'Greg' Karanikolov
    Grisha 'Greg' Karanikolov avatar
    156 posts
    14 Jun 2017
    01 Sep 2014
    Link to this post
    Hi folks,

    I think there's an example of that exactly within the Sitefinity documentation.

    There's also a video that includes an exactly that case:

    Hope that helps!

    Grisha 'Greg' Karanikolov
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
3 posts, 0 answered