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

Forums / Developing with Sitefinity / Need Publication Date for Generic Content Items

Need Publication Date for Generic Content Items

9 posts, 0 answered
  1. Dinesh
    Dinesh avatar
    46 posts
    Registered:
    03 Aug 2009
    04 Nov 2009
    Link to this post
    Hi,

    I would like to have the publication date for generic content items. I am using content view to display the content items and I would like to display those items based on the publication date. I tried adding a meta field in the web.config under genric content but ended with no luck.

    Can any one tell me how to acheive this?


    -Thanks
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    04 Nov 2009
    Link to this post
    Hi Dinesh,

    Thank you for using our services.

    Simply adding the metafield to the web.config is not enough. You should also add server controls for handling the setting and getting the publication date. Take the following example. Add metafield:
    <add key="Generic_Content.Publication_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now" />

    In control templates ContentNewView.ascx and ContentEditView.ascx for backend located in ~/Sitefinity/Admin/ControlTemplas/Generic_Content/ add the following to the content metafields server control:
    <sf:ContentMetaFields ID="MetaFields" runat="server">
                <ItemTemplate>
                ...
                      <fieldset class="dates set">
                                <ol class="setIn">
                                    <li>
                                        <asp:Label ID="Label6" AssociatedControlID="Publication_Date" runat="server">
                                            <asp:Literal ID="Literal28" runat="server" Text="<%$Resources:PublicationDate %>"></asp:Literal>
                                            <em id="Publication_DateLabel" runat="server"></em></asp:Label>
                                        <telerik:RadDateTimePicker ID="Publication_Date" runat="server">
                                        </telerik:RadDateTimePicker>
                                    </li>
                                </ol>
                            </fieldset>
                        </ItemTemplate>
            </sf:ContentMetaFields>

    In the control templates for the the front end - ContentIViewtemList.ascx and ContentViewSingleItem.ascx located in ~/Sitefinity/ControlTemplates/Generic_Content datetime literals for getting publication dates have been added by default:
    <p class="sf_contentDate">
                   <sf:DateTimeLiteral runat="server" ID="Publication_Date" DateFormatString="D"></sf:DateTimeLiteral>
               </p>

    For all of the above you will need to work with external templates, and if you do not have them you will have to download them from your Client.Net account. Once you are done with the above map the external templates and restart the website. Then you need to go through all existing content items and edit them so that the date can be set.

    Lastly you can sort and/or filter content items in the Content View control as in the attached image.

    Kind regards,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Dinesh
    Dinesh avatar
    46 posts
    Registered:
    03 Aug 2009
    06 Nov 2009
    Link to this post
    Hi Radoslav Georgiev,

    Thanks for your information. Now, I am able to get the Publication Date in Edit mode, Preview mode.
    Also, I want the publication date in Content Items list view. So, I modified the ContentItemsList.ascx file. But, the problem is the publication date is not rendering on the list view. when I tried to sort it it is working fine but why the date is not rendering?

    I am attaching the snapshot of ContentItemsList view and the content of ContentItemsList.ascx file

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ContentItemsList.ascx.cs" Inherits="Sitefinity_Admin_ControlTemplates_Generic_Content_ContentItemsList" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Cms.Web.UI" Assembly="Telerik.Cms.Web.UI" %>

    <sf:JsFileLink id="jsLink" runat="server" ScriptType="jQuery"></sf:JsFileLink>

    <div style="display:none;">
        <asp:TextBox ID="FilterExpressionField" runat="server"></asp:TextBox>
    </div>
    <div class="ToolsAll">
        <asp:HyperLink ID="createNewButton" runat="server" cssClass="CmsButLeft new">
            <strong class="CmsButRight light">
                <asp:Literal ID="createNewButtonText" runat="server" />
            </strong>
        </asp:HyperLink>
        <asp:PlaceHolder ID="fullWindow" runat="server">
        <div class="searchItems">
            <div class="searchInputs">
                <asp:Label ID="searchFieldLabel" AssociatedControlID="searchField" runat="server"></asp:Label>
                <asp:DropDownList ID="searchField" runat="server"></asp:DropDownList>
                <asp:Label ID="searchWordsLabel" AssociatedControlID="searchWords" runat="server"></asp:Label>
                <asp:TextBox ID="searchWords" CssClass="searchString" runat="server"></asp:TextBox>
                <asp:Button ID="searchButton" runat="server" CssClass="searchButton"/>
            </div>
        </div>
        </asp:PlaceHolder>
        <div class="clear"><!-- --></div>
    </div>
    <div class="workArea">
        <telerik:MessageControl runat="server" ID="message">
            <ItemTemplate>
                <asp:Label runat="server" ID="messageText"></asp:Label>
            </ItemTemplate>
        </telerik:MessageControl>
        <h2 class="gridTitle">
            <asp:Label ID="title" Text="<%$Resources:AllContentItems %>" runat="server" />
        </h2>
        <telerik:ClientTemplatesHolder ID="GridTemplates" runat="server">
            <telerik:ClientTemplate ID="ClientTemplate1" Name="Edit" runat="server">
                <a href="<%= ((Telerik.Cms.Engine.WebControls.Admin.ContentItemsList<Telerik.Cms.Engine.WebControls.Admin.ContentItemsView>)Parent.Parent).ItemEditUrl %>"><asp:Literal ID="Literal1" Text="<%$ Resources:Edit %>" runat="server" /></a>
            </telerik:ClientTemplate>
            <telerik:ClientTemplate ID="ClientTemplate2" Name="Delete" runat="server">
                <a href="javascript:if(confirm('<%= GetLocalResourceObject("AreYouSure_Delete") %>')) DeleteContent('{#ID#}')"><asp:Literal ID="Literal2" Text="<%$ Resources:Delete %>" runat="server" /></a>
            </telerik:ClientTemplate>
            <telerik:ClientTemplate ID="ClientTemplate3" 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 ID="ClientTemplate4" Name="Author" runat="server">
                {#MetaFields.Author#}
            </telerik:ClientTemplate>
            <telerik:ClientTemplate ID="ClientTemplate7" Name="Author" runat="server">
                {#MetaFields.Publication_Date#}
            </telerik:ClientTemplate>        
            <telerik:ClientTemplate ID="ClientTemplate5" Name="Description" runat="server">
                {#MetaFields.Description#}
            </telerik:ClientTemplate>
            <telerik:ClientTemplate ID="ClientTemplate6" 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">
            <MasterTableView AllowMultiColumnSorting="false" CssClass="listItems listItemsBindOnClient" Width="98%">
                <Columns>
                    <telerik:GridTemplateColumn ItemStyle-CssClass="gridActions edit" UniqueName="Edit">
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn
                        UniqueName="Delete" ItemStyle-CssClass="gridActions delete">
                    </telerik:GridTemplateColumn>
                    <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="Publication_Date"  
                        SortExpression="Publication_Date"
                        HeaderText="<%$ Resources:Publication_Date%>">
                    </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" />
            </ClientSettings>
        </telerik:RadGrid>
        </div>
        <asp:HiddenField ID="cultureInfoField" runat="server" />
         <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
    <!--
    var dataProviderName = "<%= ((Telerik.Cms.Engine.WebControls.Admin.ContentItemsList<Telerik.Cms.Engine.WebControls.Admin.ContentItemsView>)Parent.Parent).ProviderName %>";
    var gridTemplates = ClientTemplates.GetSet("<%= GridTemplates.ClientID %>");
    var allowDelete = "<%= ((Telerik.Cms.Engine.WebControls.Admin.ContentItemsList<Telerik.Cms.Engine.WebControls.Admin.ContentItemsView>)Parent.Parent).AllowDelete %>";
    var allowModify = "<%= ((Telerik.Cms.Engine.WebControls.Admin.ContentItemsList<Telerik.Cms.Engine.WebControls.Admin.ContentItemsView>)Parent.Parent).AllowModify %>";

    function loadData() {
        var tableView = $find('<%= ItemsGrid.ClientID %>').get_masterTableView();
        var currentPageIndex = tableView.get_currentPageIndex();
        var pageSize = tableView.get_pageSize();
        var filterExpressionField = document.getElementById('<%= FilterExpressionField.ClientID %>');
        DataBindGrid(currentPageIndex, pageSize, "", filterExpressionField.value);
    }
    Sys.Application.add_load(loadData);
    function DataBindGrid(currentPageIndex, pageSize, sortExpressionsAsSQL, filterExpressionsAsSQL) {
        var requiredMetaFields = ['Name', 'Author', 'Description'];
        var cultureInfoField = document.getElementById('<%= cultureInfoField.ClientID %>');
        Telerik.Cms.Engine.Services.ContentService.GetContentItems(currentPageIndex * pageSize, pageSize,
        sortExpressionsAsSQL, filterExpressionsAsSQL, requiredMetaFields, cultureInfoField.value, dataProviderName, updateGrid, OnFailed);
    }
    function RadGrid_Command(sender, args) {
        args.set_cancel(true);
        var currentPageIndex = sender.get_masterTableView().get_currentPageIndex();
        var pageSize = sender.get_masterTableView().get_pageSize();
        var sortExpressions = sender.get_masterTableView().get_sortExpressions();
        var filterExpressions = sender.get_masterTableView().get_filterExpressions();
        if (sortExpressions.length > 0 && filterExpressions.length > 0 && currentPageIndex > 0) {
            sender.get_masterTableView().set_currentPageIndex(0);
        }
        var filterExpressionField = document.getElementById('<%= FilterExpressionField.ClientID %>');
        var sortExpressionsAsSQL = sortExpressions.toString();
        var filterExpressionsAsSQL = filterExpressions.toString();
        if(filterExpressionsAsSQL.length == 0)
            filterExpressionsAsSQL = filterExpressionField.value;
        DataBindGrid(currentPageIndex, pageSize, sortExpressionsAsSQL, filterExpressionsAsSQL);
    }
    function updateGrid(result) {
        var tableView = $find("<%= ItemsGrid.ClientID %>").get_masterTableView();
        tableView.set_virtualItemCount(result.Count);
        tableView.set_dataSource(result.Data);
        tableView.dataBind();
        
        var emptyWindow = document.getElementById('empty');
        var gridPlaceholder = document.getElementById('gridPlaceholder');
        if(result.Count > 0)
        {
            emptyWindow.style.display = 'none';
            gridPlaceholder.style.display = '';
        }
        else
        {
            emptyWindow.style.display = '';
            gridPlaceholder.style.display = 'none';
        }
    }
    function RadGrid_RowDataBound(sender, args) {
        var dataItem = args.get_dataItem();
        var item = args.get_item();
        var columns = item.get_owner().get_columns();
        var cells = args.get_item().get_element().cells;
        
        if(dataItem['IsLocked'] == true) {
            args.get_item().get_element().className = "cms_locked";
        }
        else {
            args.get_item().get_element().className = "";
        }
        
        for (var i = 0; i < cells.length; i++) {
            var cell = cells[i];
            var html = gridTemplates.Replace(columns[i].get_element().UniqueName, dataItem);
            if (html != null)
                if( html != "")
                    cell.innerHTML = html;
                else
                    cell.innerHTML = "&nbsp;";
        }
        
        // disable delete if needed
        if(dataItem['IsDisabled'] == true || (allowDelete.toLowerCase() == 'false' && dataItem['IsOwner'] == false)) {
            $(args.get_item().get_element()).children(".delete").children("a").removeAttr("href");
            $(args.get_item().get_element()).children(".deleteDis").children("a").removeAttr("href");
            $(args.get_item().get_element()).children(".delete").addClass("deleteDis");
            $(args.get_item().get_element()).children(".delete").removeClass("delete");
        }
        else {
            $(args.get_item().get_element()).children(".deleteDis").addClass("delete");
            $(args.get_item().get_element()).children(".deleteDis").removeClass("deleteDis");
        }
        
        // disabled edit if needed
        if (dataItem['IsDisabled'] == true || (allowModify.toLowerCase() == 'false' && dataItem['IsOwner'] == false)) {
            $(args.get_item().get_element()).children(".edit").children("a").removeAttr("href");
            $(args.get_item().get_element()).children(".editDis").children("a").removeAttr("href");
            $(args.get_item().get_element()).children(".edit").addClass("editDis");
            $(args.get_item().get_element()).children(".edit").removeClass("edit");
        }
        else {
            $(args.get_item().get_element()).children(".editDis").addClass("edit");
            $(args.get_item().get_element()).children(".editDis").removeClass("editDis");
        }
    }
    function OnFailed(error) {
        alert("Stack Trace: " + error.get_stackTrace() + "/r/n" +
            "Error: " + error.get_message() + "/r/n" +
            "Status Code: " + error.get_statusCode() + "/r/n" +
            "Exception Type: " + error.get_exceptionType() + "/r/n" +
            "Timed Out: " + error.get_timedOut());
    }
    function DeleteContent(contentId) {
            Telerik.Cms.Engine.Services.ContentService.DeleteContent(contentId, dataProviderName, DeleteContent_Success, OnFailed);
    }
    function DeleteContent_Success(result) {
        var tableView = $find('<%= ItemsGrid.ClientID %>').get_masterTableView();
        var currentPageIndex = tableView.get_currentPageIndex();
        var pageSize = tableView.get_pageSize();
        var sortExpression = tableView.get_sortExpressions();
        var filterExpressionField = document.getElementById('<%= FilterExpressionField.ClientID %>');
        var sortExpressionAsSQL = sortExpression.toString();
        var filterExpressionAsSQL = filterExpressionField.value.toString();
        DataBindGrid(currentPageIndex, pageSize, sortExpressionAsSQL, filterExpressionAsSQL);
    }
    -->
            </script>
        </telerik:RadCodeBlock>
        <asp:PlaceHolder ID="emptyWindow" runat="server">
            <div id="empty">
                <h2 class="gridTitle"><telerik:SfLiteral ID="SfLiteral1" runat="server" Text="<%$Resources:NoContent %>"></telerik:SfLiteral></h2>
                <p><asp:HyperLink ID="createNewEmpty" runat="server" cssClass="mainLink" ToolTip="<%$Resources:CreateYourFirstContentTooltip %>"><strong><telerik:SfLiteral ID="Literal3" runat="server" Text="<%$Resources:CreateYourFirstContent %>"></telerik:SfLiteral></strong></asp:HyperLink><br />
                <telerik:SfLiteral ID="Literal4" runat="server" Text="<%$Resources:Or %>"></telerik:SfLiteral>, <a href="http://www.sitefinity.com/sf3/faq.html#gc" target="_blank" title="Opens in new browser window"><telerik:SfLiteral ID="Literal5" runat="server" Text="<%$Resources:CheckGenericContentFAQ %>"></telerik:SfLiteral></a></p>       
            </div>
        </asp:PlaceHolder>
    </div>


    Could you please look into the file and tell me what is wrong with it.


    -Thanks
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    06 Nov 2009
    Link to this post
    Hi Dinesh,

    When the grid is bound you do not call the metakey for Publication_Date. Try modifying DataBindGrid as shown below

    function DataBindGrid(currentPageIndex, pageSize, sortExpressionsAsSQL, filterExpressionsAsSQL) {
        var requiredMetaFields = ['Name', 'Author', 'Description', 'Publication_Date'];
        var cultureInfoField = document.getElementById('<%= cultureInfoField.ClientID %>');
        Telerik.Cms.Engine.Services.ContentService.GetContentItems(currentPageIndex * pageSize, pageSize,
        sortExpressionsAsSQL, filterExpressionsAsSQL, requiredMetaFields, cultureInfoField.value, dataProviderName, updateGrid, OnFailed);
    }


    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Dinesh
    Dinesh avatar
    46 posts
    Registered:
    03 Aug 2009
    06 Nov 2009
    Link to this post
    Hi Ivan,

    That Works...
    It is displaying the date in the following format "Friday, November 06, 2009 11:54:06 AM"

    How can I change the date format to the below one:
    06 Nov 2009, 11:54:AM


    -Thanks
  6. Dinesh
    Dinesh avatar
    46 posts
    Registered:
    03 Aug 2009
    06 Nov 2009
    Link to this post
    Also, When I sort publication date, it is displaying the items which has the publication date defined and it is not displaying the remaining items.
    Is there a way to display the items which do not have the publication date also so that, I come to know and set the date field for remaining items.

    -Thanks
  7. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    09 Nov 2009
    Link to this post
    Hello Dinesh,

    To format the publication date string add the highlighted to the for loop in the RowDataBound function of the grid:
    function RadGrid_RowDataBound(sender, args) {
        var dataItem = args.get_dataItem();
        var item = args.get_item();
        var columns = item.get_owner().get_columns();
        var cells = args.get_item().get_element().cells;
         
        if(dataItem['IsLocked'] == true) {
            args.get_item().get_element().className = "cms_locked";
        }
        else {
            args.get_item().get_element().className = "";
        }
         
        for (var i = 0; i < cells.length; i++) {
            var cell = cells[i];
            var elementName = columns[i].get_element().UniqueName;
            var html = gridTemplates.Replace(elementName, dataItem);
            if (html != null)
                if(html != "") {
                    var date = null;
                     
                    if(elementName == 'Publication_Date') {
                        date = new Date(dataItem['MetaFields'].Publication_Date);
                    }
                    if(date) {
                        html = date._toFormattedString('dd MMM yyyy, hh:mm tt', Sys.CultureInfo.CurrentCulture);
                    }
                     
                    cell.innerHTML = html;
                }
                else {
                    cell.innerHTML = " ";
                }
        }
         
        // disable delete if needed
        if(dataItem['IsDisabled'] == true || (allowDelete.toLowerCase() == 'false' && dataItem['IsOwner'] == false)) {
            $(args.get_item().get_element()).children(".delete").children("a").removeAttr("href");
            $(args.get_item().get_element()).children(".deleteDis").children("a").removeAttr("href");
            $(args.get_item().get_element()).children(".delete").addClass("deleteDis");
            $(args.get_item().get_element()).children(".delete").removeClass("delete");
        }
        else {
            $(args.get_item().get_element()).children(".deleteDis").addClass("delete");
            $(args.get_item().get_element()).children(".deleteDis").removeClass("deleteDis");
        }
         
        // disabled edit if needed
        if (dataItem['IsDisabled'] == true || (allowModify.toLowerCase() == 'false' && dataItem['IsOwner'] == false)) {
            $(args.get_item().get_element()).children(".edit").children("a").removeAttr("href");
            $(args.get_item().get_element()).children(".editDis").children("a").removeAttr("href");
            $(args.get_item().get_element()).children(".edit").addClass("editDis");
            $(args.get_item().get_element()).children(".edit").removeClass("edit");
        }
        else {
            $(args.get_item().get_element()).children(".editDis").addClass("edit");
            $(args.get_item().get_element()).children(".editDis").removeClass("editDis");
        }
    }

    For the content items that do not have publication date set you can use the API to loop through all content Items and set a publication date to those that do not have one:
    ContentManager cntManager = new ContentManager("Generic_Content");
    foreach (IContent cntItem in cntManager.GetContent())
    {
        DateTime pubDate = (DateTime)cntItem.GetMetaData("Publication_Date");
        if (pubDate == null)
        {
            //set some arbitrary date
            cntItem.SetMetaData("Publication_Date", DateTime.Now);
            cntManager.SaveContent(cntItem);
            }
    }

    All the best,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. promedia
    promedia avatar
    4 posts
    Registered:
    16 Aug 2004
    07 Apr 2010
    Link to this post

    Hello Radoslav ,

    I tried following your instructions to add Publication Date to Generic Items but it is not working. Here is what I have done:

    1) Added the following line to my web.config (found in line 447 of attached web.config file): 
      <add key="Generic_Content.Publication_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now" />

     

    2) Added the following files/folders to the ~/Sitefinity/Admin/ControlTemplas/Generic_Content/ folder of my project:
    a) ContentNewView.ascx 
    b) ContentEditView.ascx 
    c) App_LocalResources folder which includes these files: ContentEditView.ascx.resx, ContentNewView.ascx.resx and ContentVersionView.aspx.resx

    3) Added the following files/folders to the ~/Sitefinity/ControlTemplas/Generic_Content/ folder of my project:
    a) ContentViewItemList.ascx
    b) ContentViewSingleItem.ascx
    c) App_LocalResources folder which includes these files: ContentViewItemList.ascx.resx, ContentViewSingleItem.ascx.resx

    4) Added this code to the ContentNewView.ascx and ContentEditView.ascx files inside ~/Sitefinity/Admin/ControlTemplas/Generic_Content/

    <sf:ContentMetaFields ID="MetaFields" runat="server">
           <ItemTemplate>
       <!-- Added to file to include Publication Date -->
                           <fieldset class="dates set">
                               <ol class="setIn">
                                   <li>
                                       <asp:Label ID="Label6" AssociatedControlID="Publication_Date" runat="server">
                                           <asp:Literal ID="Literal28" runat="server" Text="<%$Resources:PublicationDate %>"></asp:Literal>
                                           <em id="Publication_DateLabel" runat="server"></em></asp:Label>
                                       <telerik:RadDateTimePicker ID="Publication_Date" runat="server">
                                       </telerik:RadDateTimePicker>
                                   </li>
                               </ol>
                           </fieldset>
           </ItemTemplate>
       </sf:ContentMetaFields>

     

    5) Mapped the external templates inside the Telerik.Sitefinity.Configuration.ControlsConfig.xml with this code:

    <!--Provides user interface for editing a content item in the Generic Content module.-->
      <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemEdit`1[[Telerik.Cms.Engine.WebControls.Admin.ContentItemsView, Telerik.Cms.Engine]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/ContentEditView.ascx" />
      <!--Provides user interface for adding a new content item in the Generic Content module.-->
      <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemNew`1[[Telerik.Cms.Engine.WebControls.Admin.ContentItemsView, Telerik.Cms.Engine]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/ContentNewView.ascx" />
      <viewSettings hostType="Telerik.Cms.Engine.WebControls.ContentView">
        <additionalTemplates>
          <!--Provides user interface for displaying a single content item in the ContentView control in the Generic Content module.-->
          <add key="SingleItemTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Generic_Content/ContentViewSingleItem.ascx" />
          <!--Provides user interface for displaying a list of content items in the ContentView control in the GenericContent module.-->
          <add key="ItemListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Generic_Content/ContentViewItemList.ascx" />
        </additionalTemplates>
      </viewSettings>

    6) Lastly, I have restarted IIS. 

    The Publication date doesn't appear anywhere - not in the admin area nor in the public list items view. What do I need to do to fix this?
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    08 Apr 2010
    Link to this post
    Hi promedia,

    The screenshots refer path /Sitefinity/Admin/ControlTemplates/ etc, since in your post you said that you used

    • /Sitefinity/ControlTemplas/Generic_Content/
    Is this a typo or  not? All steps that you have followed looks correct and I could not find any reason for not displaying the custom fields in the backend or front end. Make sure that the files you are editing belongs to the project you are currently work on and the application has been restarted.
    Best wishes,
    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
9 posts, 0 answered