+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / What best practice using Related Data in Sitefinity 7

What best practice using Related Data in Sitefinity 7

4 posts, 0 answered
  1. Aseven7
    Aseven7 avatar
    15 posts
    Registered:
    16 Mar 2014
    08 Jul 2014
    Link to this post

    Hi experts,

    What should use if using related data (especially for dynamic content related data) , on Sitefinity 7 as i know 2 things:

    1. adding a custom field on content type with field type related data, or...
    2. adding parent child (ex. content A has child content B it makes automatic related data)

    so, what best practice for this case ? Thank you. I appreciated for an answer.

    Regards,

  2. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    10 Jul 2014
    Link to this post
    Hello Anthony,

    There is no best approach here. Both methods are viable and you should choose based on your preferences. I can personally recommend you use the first approach as there you can have multiple related data items, while multiple child modules with a single parent one is not possible in our system for the time being.

    Regards,
    Ivan D. Dimitrov
    Telerik
     
    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. Aseven7
    Aseven7 avatar
    15 posts
    Registered:
    16 Mar 2014
    10 Jul 2014
    Link to this post
     May I have a sample code for the widget template for the second point (I did not find documented on the sitefinity documentation for the widget template of the second point about related content between dynamic content parent and dynamic content child (not related data field) )
  4. Aseven7
    Aseven7 avatar
    15 posts
    Registered:
    16 Mar 2014
    11 Jul 2014
    Link to this post

    anyway, i found the solutions point 2nd for widget template parent-child related data : 

    using this syntax to datasource repeater/ list

    <%# Telerik.Sitefinity.DynamicModules.DynamicModuleManager.GetManager().GetChildItems((Telerik.Sitefinity.DynamicModules.Model.DynamicContent)Container.DataItem) %>

    .... register block & assembly block....

    ....
    <telerik:RadListView ID="dynamicContentListView" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
        <LayoutTemplate>
            <ul>
                <asp:PlaceHolder ID="ItemsContainer" runat="server" />
            </ul>
        </LayoutTemplate>
        <ItemTemplate>
            <li class="sfitem sflistitem sfClearfix" data-sf-provider='<%# Eval("Provider.Name")%>' data-sf-id='<%# Eval("Id")%>' data-sf-type="Telerik.Sitefinity.DynamicModules.Model.DynamicContent">
                <img src='<%# ((Telerik.Sitefinity.Libraries.Model.Image)Eval("Image")).Url %>' />
                <ul>
                    <asp:Repeater ID="Repeater1" runat="server" DataSource='<%# Telerik.Sitefinity.DynamicModules.DynamicModuleManager.GetManager().GetChildItems((Telerik.Sitefinity.DynamicModules.Model.DynamicContent)Container.DataItem) %>'>
                        <ItemTemplate>
                            <li>
                                <%# Eval("Title") %>
                            </li>
                        </ItemTemplate>
                    </asp:Repeater>
                </ul>
            </li>
        </ItemTemplate>
    </telerik:RadListView>
    ....

     ...

     

4 posts, 0 answered