More in this section

Forums / Developing with Sitefinity / Generic Content Template

Generic Content Template

2 posts, 0 answered
  1. Richard
    Richard avatar
    4 posts
    13 May 2008
    15 May 2008
    Link to this post

    With the NewsList control I'm able to set the TemplateUrl (to a .ascx) file i would like to use and easily customize the apperance.

    I would like to do the same with a the Generic Content control, but there is no such property other than editortemplate.

    It would be nice to have that option as i then easialy can wrap my content with e.g. <div> or other html elements and style with classes. That way i do not need to add several <asp:contentplaceholders> and surround these with <div> etc.

    is it already possible to do what i request today? if so please let me know or help me out how to get started, i know how i could build a custom control that derives from the GenericContent control, but not how to impletement the Template part.

    Any help would be greatly appriciated,

  2. Nikifor
    Nikifor avatar
    232 posts
    18 May 2013
    19 May 2008
    Link to this post
    Hi Richard,

    The suggestion for having a Select button when choosing a Generic Content template sounds reasonable and we will consider it for one of the upcoming releases. Meanwhile, we have a suggestion for you which would help you to  work around the inconvenience in a way. There is a way to add one default template which will be automatically called each time a Generic Control is placed on a page. It is enough to define such template in the web.config file as shown:

        <cmsEngine defaultProvider="Generic_Content"
            <clear /> 
            <add name="Generic_Content" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="True" defaultMetaField="Name" securityProviderName="" allowLocalization="False" allowVersioning="True" allowWorkflow="False" allowComments="false" commentsModeration="true" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, Telerik.Cms.Engine.Data" EditorTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/EditorTemplate.ascx" /> 
    Where the highlighted attribute is the one which should be added. You can specify the path to your own template.

    Hope this helps.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered