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

Forums / Developing with Sitefinity / Mapping View to External Template

Mapping View to External Template

29 posts, 0 answered
  1. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    12 Oct 2010
    Link to this post
    Hi Guys,

    I am trying to figure out how this map a view to an external template works.

    I have followed these instructions but it still does not make sense to me if I was going to upgrade for whatever reason. Surely, to keep Sitefinity stuff separate from my own templates during upgrade, I would have to create a folder called something like ~/Extensions/ControlTemplates/ and put my templates in there to keep them separate from the ~/Sitefinity/Admin/ControlTemplates which would otherwise be overwritten when one does an upgrade?

    I don't mind doing it your way but I am trying to understand the logic behind it.

    The purpose of having the ability to map a view to a template is so that one does not overwrite the SF version but for my own template to add to Sitefinity's templates.

    I hope this makes sense, I may be getting lost in my own process here.

    Thanks,
    James
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    12 Oct 2010
    Link to this post
    Hello James,

    Thank you for using our services.

    The idea is that you will map a certain set of templates, and then you will always know which are the mapped templates by taking a look at the controls config file. Now with different upgrades of Sitefinity we also change some of the control templates and include them in the binaries. In the old approach if you apply the patch without remembering in which templates you have made changes the patch would just remove your changes and use the default templates. With the embedded templates approach and the controls config file when you apply a patch it does not ovewrite your changes and keeps them.

    Greetings,
    Radoslav Georgiev
    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. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    12 Oct 2010
    Link to this post
    Hi Radoslav,

    Thanks for getting backing to me about this again. So my understanding is this:

    1. The Sitefinity ControlTemplates are wrapped inside your DLL files, meaning I can not overwrite them?
    2. In the folder ~/Sitefinity/Admin/ControlTemplates I dump the control templates I need?
    3. The controls config file is what I use to map to these Control Templates?

    Now if I were to upgrade:

    1. I would use the controls config to check which Control Templates I have recently worked on.
    2. If I then copy and paste the folders from the patch, the folders are copied but the ControlTemplates remain in place?

    I think the part that baffled me was the copying over of the patch folders. I needed to do a quick test now to prove that if you overwrite a folder with another one that has something in it already , the files remain in tact.

    Is my understanding of this better?

    Apologies if this seems common knowledge.  :)

    Cheers


  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    12 Oct 2010
    Link to this post
    Hello James,

    I understand it might be a little bit confusing.

    The patch does not contain the external templates. So when you apply the patch, files you have added to ControlTemplates will not be overwritten. You have to download the external templates archive for the version you have upgraded to to do this. With each upgrade we introduce we list the changes in control templates from the previous version, so that you know which files have changed from the previous version and if you are using those files you need to merge your code with the new version of the templates.

    Greetings,
    Radoslav Georgiev
    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
  5. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    12 Oct 2010
    Link to this post
    The light bulb is on! Thanks Radoslav for all your help! :)
  6. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    12 Oct 2010
    Link to this post
    One more thing please Radoslav!

    Now that I know how to apply my Control Template, how do I go about finding out which of the ControlTemplates is the correct one to modify. In the case of the the blog module, there are many possible options to choose from.

    Do you have a list of them Control Template names and the outcome they might produce in image formate please?

    Thanks,
    James
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    12 Oct 2010
    Link to this post
    Hello James,

    In the archive of templates there is a file Telerik.Sitefinity.Configuration.ControlsConfig.xml which provides description for each view and the template that this view should use.

    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
  8. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    12 Oct 2010
    Link to this post
    Thanks Ivan. I will have a look at that...

    Cheers,
    James
  9. Roopesh
    Roopesh avatar
    39 posts
    Registered:
    29 Oct 2010
    09 Nov 2010
    Link to this post


    Hello

    I want to use an external template for my blog .I followed all the steps from http://www.sitefinity.com/devnet/kb/sitefinity-3-x/how-to-map-a-view-to-an-external-template-in-sitefinity-3-6-or-later.aspx
    But i am getting this error .I am using SF3 .7 . please give me solution

    A required control was not found in the template for "~/Sitefinity/Admin/ControlTemplates/Blogs/BlogsItemNew.ascx". The control must be assignable form type "System.Web.UI.IEditableTextControl" and must have ID "Editor".

  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    09 Nov 2010
    Link to this post
    Hello Roopesh,

    You have removed the RadEditor control from BlogsItemNew.ascx template  or you have change its ID.

    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
  11. Roopesh
    Roopesh avatar
    39 posts
    Registered:
    29 Oct 2010
    09 Nov 2010
    Link to this post
    I am planing to use my own control to add news ..how can i do that?
  12. Roopesh
    Roopesh avatar
    39 posts
    Registered:
    29 Oct 2010
    09 Nov 2010
    Link to this post
    Hello Ivan Dimitrov

    How can i create my own news adding page?

    Thank You
    Roops
  13. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    09 Nov 2010
    Link to this post
    Hello Roopesh,

    You have to use Generic Content API - Overview of Generic Content API

    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
  14. Roopesh
    Roopesh avatar
    39 posts
    Registered:
    29 Oct 2010
    09 Nov 2010
    Link to this post
    Hello Ivan Dimitrov 

    I got good help from Generic Content API - Overview of Generic Content API. Now i am able to create news item .Now i need to use my control instead of sitefinity default news item .can you help me to do that?
    Thank you 
    Roops
  15. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    09 Nov 2010
    Link to this post
    Hi Roopesh,

    Removing the default NewsView control is equivalent to disabling the news module. You can register your custom control inside <toolboxControls> section of the web.config and use it or/ and hide the default control.

    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
  16. Roopesh
    Roopesh avatar
    39 posts
    Registered:
    29 Oct 2010
    09 Nov 2010
    Link to this post
    Hello Ivan Dimitrov,

    Your previous answer was for hiding toolbox item (User custom controls).  But I want to hide sitefinity inbuilt news module  add news item and replaced with my own news adding code.please help me 

    Thank You 
    Roops
  17. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    09 Nov 2010
    Link to this post
    Hi Roopesh,

    You can hide each control from the toolbox no matter of its type following the same logic. If you want  you can disable the entire News module which will remove the control and the backend module.  You can take a look at this KB.

    Sincerely yours,
    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
  18. Roopesh
    Roopesh avatar
    39 posts
    Registered:
    29 Oct 2010
    09 Nov 2010
    Link to this post
    Hello Ivan Dimitrov ,

    It was really helpful for me .So now i am able to hide news module from admin site. Now i want to display my own news module in the admin side .My custom module contains add/edit/delete news 

    Thanks 
    Roops
  19. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    09 Nov 2010
    Link to this post
    Hello Roopesh,

    You can take a look at our sample modules in this post

    All the best,
    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
  20. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    25 Jan 2011
    Link to this post
    Hi Guys,

    I am back with this issue of mapping views again and would appreciate the help.

    I am trying to map to the Blog Module so that I can skin it to look like I want.

    In my Telerik.Sitefinity.Configuration.ControlsConfig.xml, I have added this configuration:

    <viewSettings hostType="Telerik.Blogs.WebControls.BlogPosts">
          <additionalTemplates>
            <!--Provides user interface for displaying a list of posts in the BlogPosts control in the blogs module.-->
            <add key="ItemListTemplate" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Blogs/ContentViewItemList.ascx" />
            <!--Provides user interface for displaying a single post in the BlogPosts control in the blogs module.-->
            <add key="SingleItemTemplate" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Blogs/ContentViewSingleItem.ascx" />
          </additionalTemplates>
        </viewSettings>


    I have then downloaded the templates for Sitefinity_3_7_standard_trial_ExternalTemplates and copied ContentViewItemList.ascx and ContentViewSingleItem.ascx into ~/Sitefinity/Admin/ControlTemplates/Blogs/ContentViewItemList.ascx and ~/Sitefinity/Admin/ControlTemplates/Blogs/ContentViewSingleItem.ascx respectively.

    If I then run my app, I get errors like this:

    Server Error in '/' Application.

    Parser Error

    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

    Parser Error Message: The resource object with key 'GoBack' was not found.

    Source Error: 

    Line 6:  <sfWeb:HeaderLinks id="headerLinks" runat="server" />
    Line 7:  
    Line 8:  <asp:HyperLink ID="backLink" runat="server" Text="<%$Resources:GoBack %>" />
    Line 9:  <asp:Repeater ID="repeater" runat="server">
    Line 10:  <HeaderTemplate>

    Source File: /Sitefinity/Admin/ControlTemplates/Blogs/ContentViewItemList.ascx    Line: 


    Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955


    If I delete the 
    <asp:HyperLink ID="backLink" runat="server" Text="<%$Resources:GoBack %>" />
    to see if it works, it only fails at the next ASP control.

    Can someone please let me know what this could be?

    Thanks,
    James


  21. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    25 Jan 2011
    Link to this post
    Hello James@Nw,

    Do you have a resx key - GoBack and resx file for ContentViewSingleItem.ascx. If not, please add them.

    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
  22. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    26 Jan 2011
    Link to this post
    Hi Ivan,

    Could you please tell me what a resx key is? I have now done a windows search in the Sitefinity_3_7_standard_trial_ExternalTemplates for all resx files and added all the resx files associated with the blog to the App_LocalResources folder. 

    I then reset IIS and ran the site again but still have this error.

    In my search for all resx files, I found nothing that points to GoBack.

    Many thanks,
    James
  23. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Jan 2011
    Link to this post
    Hi James@Nw,

    Please check out this article in MSDN magazine Basic Instincts: Resources and Localization

    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
  24. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    26 Jan 2011
    Link to this post
    Hi Ivan,

    Thanks for sending me this and I will read through it but I've followed your instructions on how to map a view to an external template in Sitefinity and surely this page needs to be updated then to include all examples of mapping these views?

    I've followed all of those instructions and surely the outcome thereof should sort out my problem?

    Can you guys be more specific in your tutorials and answers please?

    I've left a suggestion here for you guys to better help your clients who may not be developers but rather designers of Sitefinity.

    Surely if there are many people asking questions on this topic, then your instruction pages need to be more in depth to cover the broader spectrum of the task at hand?

    "Do you have a resx key - GoBack and resx file for ContentViewSingleItem.ascx. If not, please add them." to me makes no sense as a designer and should maybe have been followed up with the Basic Instincts link you sent but now we have to wait for long periods for a proper answer to sort out a problem with your product.

    Forgive me, I don't mean to be rude but we have deadlines to meet and it takes a lot of time getting responses from the forums sometimes.

    Cheers,
    James

  25. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    26 Jan 2011
    Link to this post
    Hi Ivan,

    Ok, I have now posted on StackOverflow to find out what a resx key is and one of the guys gave me an answer and this link.

    http://msdn.microsoft.com/en-us/library/ms227427.aspx

    Although, I have now read through this it still tells me that I need a resx file which should be coming from you, Sitefinity?

  26. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Jan 2011
    Link to this post
    Hello James@Nw,

    The resource file is included in the external templates we provide. You can check

    [Sitefinity_3_7_standard_ExternalTemplates]\Sitefinity\ControlTemplates\Blogs\App_LocalResources

    This folder has three files

    • CommentsList.ascx.resx
    • ContentViewItemList.ascx
    • ContentViewSingleItem.ascx.resx

    Inside ContentViewSingleItem there must be the following key

    <data name="GoBack" xml:space="preserve">
        <value>Go Back</value>
      </data>


    Using resx file is something very general in ASP.NET and this is not something specific to Sitefinity itself.

    I also suggest that you should use mode templates that are available for download inside

    [Sitefinity_3_7_standard_ExternalTemplates]\Sitefinity\Admin\ControlTemplates\Blogs\Modes

    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
  27. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    26 Jan 2011
    Link to this post
    Thanks Ivan.

    If I can point something out and which might be the cause of all these problems...
    In your post, you point to this folder:
    Sitefinity/ControlTemplates...

    And yet, on this page you guys instruct people to work in this folder:

    /Sitefinity/Admin/ControlTemplates...

    Could you guys please follow up with clearer instructions on that page and give more examples of how to skin/style the modules?

    One last thing, what is the Modes template about now? This instruction page does not cover that topic. It would be more helpful if you could send me a link if there is any reference material for this?


  28. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    26 Jan 2011
    Link to this post
    Hello James@Nw,

    Sitefinity/ControlTemplates...

    This folder contains control templates and localization resources for public controls. The KB article gives this path for public controls

    /Sitefinity/Admin/ControlTemplates...

    Contains control templates and localization resources for the administrative (backend) controls, as the blog post suggests - it is to map backend controls (suggested in the blog post's title).

    Best wishes,
    Radoslav Georgiev
    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
  29. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    26 Jan 2011
    Link to this post
    It worked, thanks Ivan...but the problem was definitely in using the wrong folder all the time. We've been working in the Admin folder, as per your instruction page. 

    "Create the file for your external template. In this case, the file should be located at~/Sitefinity/Admin/ControlTemplates/News/NewsItemNew.ascx"

    Can you guys please update this page?
Register for webinar
29 posts, 0 answered