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

Forums / Developing with Sitefinity / Expose Guid property for content modules

Expose Guid property for content modules

4 posts, 0 answered
  1. Ivan
    Ivan avatar
    51 posts
    Registered:
    22 Aug 2007
    27 Oct 2010
    Link to this post
    Hi All,

    I have the following scenario and wanted to know if it was possible to expose a content module's GUID for use in an external system.

    I am creating promos using content modules in Sitefinity.  I have a separate system which will recommend promotions based on user behavior.  In order to tie the external system to Sitefinity, a unique identifier from Sitefinity has to be provided and I wanted to use the content module's GUID.  Can I expose the GUID via the admin interface as a content module attribute?  It should not be editable.

    Thanks in advance.
    -Ivan
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    27 Oct 2010
    Link to this post
    Hello Ivan,

    Could you clarify whether you want to get the IContent ID or another object identifier. There is an interface IModule - Provides members for implementation of a module,  but it does not expose a property of type GUID.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Ivan
    Ivan avatar
    51 posts
    Registered:
    22 Aug 2007
    27 Oct 2010
    Link to this post
    Hi Ivan,

    I am referring to the IContent ID.  I'm thinking that if I can expose/show the value on screen, the content author creating the promos can easily copy and paste the GUID for use in the external system.  That way when the Sitefinity hosted site requests recommendations from the external system, it will return any relevant Sitefinity promo GUIDs that we can retrieve and display.

    If there is another way to have the same behavior I am open to suggestions.

    Thanks.
    -Ivan
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    27 Oct 2010
    Link to this post
    Hello Ivan,

    You can modify the ItemsList template of the module you want to modify

    For Generic Content control this template is Sitefinity\Admin\ControlTemplates\Generic_Content\ContentItemsList.ascx

    Then you can extend the template by adding a new client template and show the ID with a Label control

    <telerik:ClientTemplatesHolder ID="GridTemplates" runat="server">
        <telerik:ClientTemplate ID="IdLabel1" runat="server" Name="IdLabel1">
        <asp:Label runat="server" ID="lbl1" Text='{#ID#}' />
        </telerik:ClientTemplate>
       
            <telerik:ClientTemplate Name="Edit" runat="server">
                <a href="<%= ((Telerik.Cms.Engine.WebControls.Admin.ContentItemsList<Telerik.Cms.Engine.WebControls.Admin.ContentItemsView>)Parent.Parent).ItemEditUrl %>"><asp:Literal Text="<%$ Resources:Edit %>" runat="server" /></a>
            </telerik:ClientTemplate>
            <telerik:ClientTemplate Name="Delete" runat="server">
                <a href="javascript:if(confirm('<%= GetLocalResourceObject("AreYouSure_Delete") %>')) DeleteContent('{#ID#}')"><asp:Literal Text="<%$ Resources:Delete %>" runat="server" /></a>
            </telerik:ClientTemplate>
            <telerik:ClientTemplate Name="View" runat="server">
                <a href="<%= ((Telerik.Cms.Engine.WebControls.Admin.ContentItemsList<Telerik.Cms.Engine.WebControls.Admin.ContentItemsView>)Parent.Parent).ItemViewUrl %>">{#MetaFields.Name#}</a>
            </telerik:ClientTemplate>
            <telerik:ClientTemplate Name="Author" runat="server">
                {#MetaFields.Author#}
            </telerik:ClientTemplate>
            <telerik:ClientTemplate Name="Description" runat="server">
                {#MetaFields.Description#}
            </telerik:ClientTemplate>
            <telerik:ClientTemplate Name="Status" runat="server">
                {#Status#}
            </telerik:ClientTemplate>
        </telerik:ClientTemplatesHolder>
        <div id="gridPlaceholder">
        <telerik:RadGrid ID="ItemsGrid" runat="server" AutoGenerateColumns="false" AllowSorting="true" AllowPaging="true" PageSize="50" EnableViewState="false" Skin="SitefinityItems" EnableEmbeddedSkins="false"
         AllowMultiRowSelection="true">
            <MasterTableView AllowMultiColumnSorting="false" CssClass="listItems listItemsBindOnClient" Width="98%" >
                <Columns>
                <telerik:GridTemplateColumn  UniqueName="IdLabel1">
              </telerik:GridTemplateColumn>
               
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn ItemStyle-CssClass="gridActions edit" UniqueName="Edit">
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn
                        UniqueName="Delete" ItemStyle-CssClass="gridActions delete">
                    </telerik:GridTemplateColumn>
                    <telerik:GridClientSelectColumn UniqueName="CheckBoxColumn" HeaderStyle-CssClass="check" ItemStyle-CssClass="check">
                    </telerik:GridClientSelectColumn>
                    <telerik:GridTemplateColumn
                        UniqueName="View" 
                        SortExpression="Name"
                        ItemStyle-CssClass="gridContentTitle"
                        HeaderText="<%$ Resources:Name %>">
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn
                        UniqueName="Author" 
                        SortExpression="Author"
                        HeaderText="<%$ Resources:Author %>">
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn
                        UniqueName="Description" 
                        HeaderText="<%$ Resources:Description %>">
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn
                        UniqueName="Status" 
                        HeaderText="<%$ Resources:Status %>">
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
            <PagerStyle Mode="NumericPages" />
            <ClientSettings>
                <ClientEvents OnCommand="RadGrid_Command" OnRowDataBound="RadGrid_RowDataBound" OnRowSelected="RadGrid_RowSelected" OnRowDeselected="RadGrid_RowDeselected" />
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
        </telerik:RadGrid>


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered