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

Forums / Developing with Sitefinity / 3.6 Template override not working

3.6 Template override not working

9 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    24 Feb 2009
    Link to this post
    I'm trying to modify the generic content editor to add in my own styles...but it doesnt seem to be working

    I've made the file Telerik.Sitefinity.Configuration.ControlsConfig.xml in App_Data\Configuration with the content of
    <?xml version="1.0" encoding="utf-8" ?>
    <controlsConfig>
      <viewMap>
          <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" />
      </viewMap>
    </controlsConfig>


    Then I put the file in Admin\ControlTemplates\Generic_Content (the ContentEditView.ascx)

    Shouldn't that be all I need to do?...it's not picking up my changes to the EditorToolsFile.xml or changes to the ContentEditView.ascx.

  2. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    24 Feb 2009
    Link to this post
    are you using custom generic content providers or just the built in one? if you're using additional providers, check the KB http://www.sitefinity.com/support/knowledge-base/kb-article/b1154K-bcge-b1154T-cgb.aspx because you have to add a key="providername" along with some extra code to map those templates...

    also be sure you're using the configuration file from your client.net downloads, as that's the most up-to-date and correct version...

    finally, if you're sure everything is correct, try restarting your application by saving the web.config file. this will force the site to recompile and your templates SHOULD work then...

    I'm pretty sure you have to restart the app everytime you change the config file (but NOT when you change the templates), as that has been my experience.

    hope this was helpful!
  3. Dido
    Dido avatar
    149 posts
    Registered:
    24 Sep 2012
    24 Feb 2009
    Link to this post
    Hi Steve,

    Could you please elaborate a bit more what happens when you actually add this? I guess that you are using Sitefinity 3.6 Standard for .NET 3.5 with Hotfix.

    Here are all the necessary steps that need to be done:
    1. Create ~/App_Data/Configuration/Telerik.Sitefinity.Configuration.ControlsConfig.xml
    2.  Check out your EmbeddedTemplates.zip (which is different for the standard/community editions, as well as for the .NET version your copy of SF is based on) and add the appropriate <viewSettings> element.
    3. Copy the .ascx file in the path pointed by its layoutTemplatePath attribute
    4. Copy the .ascx.resx file (App_LocalResources) to your local module's App_LocalResources. In your case, the latter would be something like ~/Sitefinity/Admin/ControlTemplates/Generic_Content/App_LocalResources
    5. Make your changes to the copied .ascx file.

    As an alternative to steps 1 through 4, you could extract the whole archive contents to your project directory and edit the different templates when you need to. It is entirely up to personal preferences.

    If you see no changes, then you might have misspelled the .xml config file or mistyped something in the <viewSettings> element (especially the host type). That way Sitefinity won't know that you want to override templates at all (or not finding the correct type). Then a "silent error" will occur. This means that actually there is no error message, but you can't see the changes you make to the template no matter what you do. Please, check that your configuration file is place where it should be and that it is named Telerik.Sitefinity.Configuration.ControlsConfig.xml. Your <viewSettings> element is correct.

    As a side note: Sitefinity will NOT detect your changes until the  app pool  is restarted. You can force this very simply:
    - add and delete a space from your web.config, then save it
    - manually stop and then start the application pool from IIS
    - manually restart IIS
    Well, that is as far as embedded templates go, at least.

    If you still experience more problems, please feel free to contact us.

    Kind regards,
    Dido
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  4. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    24 Feb 2009
    Link to this post
    LOCAL RESOURCES!

    Fixed :)  Didn't move over that file....guess when it fails it defaults back to the embedded one
  5. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    25 Feb 2009
    Link to this post
    Hello Steve,

    That's correct. If the application does not find the local resources, it tries to use the embedded ones.

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. David
    David avatar
    22 posts
    Registered:
    04 May 2009
    28 Jun 2010
    Link to this post
    It seems that Sitefinity is gracefully recovering from some problem I have using customizing a template.  It looks like when things go wrong, it defaults to something that works.  But.... how do I troubleshoot the actual problem if it reverts back to some working default?
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    29 Jun 2010
    Link to this post
    Hello David,

    Sitefinity works with embedded and external templates. If the external template has not been mapped to  view or control Sitefinity is using the embedded resources. There should not be a problems ( unknown issues - bugs) when you work with the embedded templates and default functionality.

    Kind regards,
    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
  8. David
    David avatar
    22 posts
    Registered:
    04 May 2009
    07 Jul 2010
    Link to this post
    I understand the default functionality.  I'm trying to override that with an external template by configuring Telerik.Sitefinity.Configuration.ControlsConfig.xml.  When something is messed up, I don't know how to troubleshoot the problem; it just displays the default template.  Is there a way to see the exception or error message to help troubleshoot my custom template?
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    07 Jul 2010
    Link to this post
    Hi David,

    If there are problems with any control inside your template ASP.NET framework will produce an error - for instance - missing tags, resources etc.
    For other cases you need to create a custom control that inherits from the base one ( say NewsView) and make a validation depending on your needs.

    Regards,
    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