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

Forums / Developing with Sitefinity / Embedded Template

Embedded Template

12 posts, 0 answered
  1. Kalvin MacLeod
    Kalvin MacLeod avatar
    19 posts
    Registered:
    15 Nov 2005
    17 Feb 2009
    Link to this post
    Hello,

    I'm trying to use an external template for the news modules insert/edit views. I'm pretty sure I've followed all the steps from the knowledgebase on how to make the changes. I've done the following:

    1. Created a file in App_Data\Configuration called: Telerik.Sitefinity.Configuration.ControlsConfig.xml

    2. Added the following code to it (copied from the knowledgebase):

    <?

     

    xml version="1.0" encoding="utf-8" ?>
    <
    controlsConfig>
    <
    viewMap>
    <
    viewSettings hostType="Telerik.News.WebControls.Admin.NewsItemEdit`1[[Telerik.News.WebControls.Admin.NewsItemsView, Telerik.News]]" layoutTemplatePath="~/Sitefinity/Admin/News/ControlTemplates/NewsItemEdit.sft">
    </
    viewSettings>
    </
    viewMap>
    </
    controlsConfig>

     


    3. And then copied over the newsItemEdit.ascx (tried both as .sft and created as ascx) to the ~/Sitefinity/Admin/News/ControlTemplates directory

    When I try to run the site I get the following:

    Could not load file or assembly 'Telerik.News]]' or one of its dependencies. The system cannot find the file specified.

    What am I missing?
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    18 Feb 2009
    Link to this post
    Hi Kalvin MacLeod,

    The correct mapping for these templates should be:

        <viewSettings hostType="Telerik.News.WebControls.Admin.NewsItemEdit, Telerik.News" 
        layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/NewsItemEdit.ascx"
        </viewSettings> 
        <!-- Inserts a news item --> 
        <viewSettings hostType="Telerik.News.WebControls.Admin.NewsItemNew, Telerik.News" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/NewsItemNew.sft"
        </viewSettings> 

    When you rename the control template as name.ascx, the system will look for the resource files in the directory where this control is located. Of course, you will not have such resource files, and this will cause the error you receive now.
    If you keep the control with sft extension, then the system will resolve the resource lines from the embedded resources.

    We will update the KB article today. I apologize for the inconvenience.


    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.
  3. Anton Mernov
    Anton Mernov avatar
    110 posts
    Registered:
    03 Dec 2008
    18 Feb 2009
    Link to this post
    Hi guys,

    I have similar issue.
    I'm trying to use an external template for the generic content module.

    In Telerik.Sitefinity.Configuration.ControlsConfig.xml I has added next node:

        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.EditorTemplate" 
    layoutTemplatePath="~/Sitefinity/Admin/Generic_Content/EditorTemplate.sft"
        </viewSettings> 


    Into EditorTemplate.sft I has added new filter (It worked in 3.5) and  <CssFiles> tag.
    But when I use editor from admin area it not works... and into HTML source code my changes not exists.
    I think Sitefinity use embedded template instead of my.

    What I do wrong?
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    18 Feb 2009
    Link to this post
    Hello Anton,

    Could you please reset the application?
    Let us know if that will make any difference.

    Sincerely yours,
    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.
  5. Anton Mernov
    Anton Mernov avatar
    110 posts
    Registered:
    03 Dec 2008
    18 Feb 2009
    Link to this post
    Hello Georgi,

    Now I have an error:

    Could not find a type for a name.  The type name was 'Telerik.Cms.Engine.WebControls.Admin.ContentItemsList'.

    Could not find a type for a name.  The type name was 'Telerik.Cms.Engine.WebControls.Admin.ContentItemsList'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: Could not find a type for a name.  The type name was 'Telerik.Cms.Engine.WebControls.Admin.ContentItemsList'.

    Source Error:

    Line 54: 			{
    Line 55: 				Telerik.Web.IControlPanel ctrlPnl = (Telerik.Web.IControlPanel)this.contolPanel;
    Line 56: 				foreach (Telerik.Web.ICommandPanel cmdPnl in ctrlPnl.CommandPanels)
    Line 57: 					this.ToolBoxHolder.Controls.Add((Control)cmdPnl);
    Line 58: 			}


    Source File: c:\website\sitefinity\Sitefinity\Admin\Modules.aspx.cs    Line: 56


    my ControlsConfig.xml file:
    <?xml version="1.0" encoding="utf-8" ?> 
    <controlsConfig> 
      <viewMap> 
        <!--       --> 
        <!-- GENERIC CONTENT --> 
        <!--       --> 
        <!--       --> 
        <!-- Backend: --> 
        <!--       --> 
        <!-- Displays all generic content items --> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemsList" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/ContentItemsList.sft"
        </viewSettings> 
        <!-- Displays a preview of a generic content item --> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemPreview" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/ContentPreview.sft"
        </viewSettings> 
        <!-- Edits a generic content item --> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemEdit" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/ContentEditView.sft"
        </viewSettings> 
        <!-- Inserts a generic content item --> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemNew" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/ContentNewView.sft"
        </viewSettings> 
        <!-- Displays history of a generic content item --> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemHistory" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/ContentItemHistory.sft"
        </viewSettings> 
        <!-- Displays permissions for the Generic Content module --> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.PermissionsView" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/PermissionsViewWorkflow.sft"
        </viewSettings> 
        <!-- Displays all categories for the Generic Content module --> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.CategoriesView" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/CategoriesView.sft"
        </viewSettings> 
        <!-- Displays all tags for the Generic Content module --> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.TagsView" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/TagsView.sft"
        </viewSettings> 
        <!-- Displays all comments for the Generic Content module --> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.CommentsList" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/CommentsList.sft"
        </viewSettings> 
        <!-- Edits a generic content comment --> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.CommentsEdit" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/CommentsEdit.sft"
        </viewSettings> 
        <!-- Displays a preview of a generic content comment --> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.CommentsPreview" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/CommentsPreview.sft"
        </viewSettings> 
        <!--  --> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.EditorTemplate" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/EditorTemplate.sft"
        </viewSettings> 
      </viewMap> 
    </controlsConfig> 
     


  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    18 Feb 2009
    Link to this post
    Hello Anton,

    The error is thrown because of the wrong host type you have specified.

        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemsList`1[[Telerik.Cms.Engine.WebControls.Admin.ContentItemsView, Telerik.Cms.Engine]], Telerik.Cms.Engine" 
    layoutTemplatePath="~/Sitefinity/Admin/Externel/Generic_Content/ContentItemsList.sft"
        </viewSettings> 
        <!-- Edits a generic content item --> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemEdit`1[[Telerik.Cms.Engine.WebControls.Admin.ContentItemsView, Telerik.Cms.Engine]], Telerik.Cms.Engine" 
    layoutTemplatePath="~/Sitefinity/Admin/Externel/Generic_Content/ContentEditView.sft"
        </viewSettings> 

    We will attach a new list with all types to the KB How to map a view to an external template, in Sitefinity 3.6 or later?

    Kind regards,
    Ivan Dimitrov
    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.
  7. Anton Mernov
    Anton Mernov avatar
    110 posts
    Registered:
    03 Dec 2008
    18 Feb 2009
    Link to this post
    Hello Ivan,

    Thanks, it works!

    But in Sitefinity 3.5 folder ~/Sitefinity/Admin/ControlTemplates/Generic_Content/ hold EditorTemplate.ascx where I can to change a lot of settings of RadEditor control.

    It is possible now to do this in Sitefinity 3.6?

    Best regards,
    Anton.
  8. Anton Mernov
    Anton Mernov avatar
    110 posts
    Registered:
    03 Dec 2008
    18 Feb 2009
    Link to this post
    As far as I understand, I can do this by editing file
    ~\Sitefinity\Admin\ControlTemplates\Generic_Content\ContentEditView.sft

    However, file ~/Sitefinity/Admin/ControlTemplates/Generic_Content/EditorTemplate.ascx in 3.5 also used when I place generic_content module into contentplaceholder on the page.

    In Sitefinity 3.6 i want to do same.
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    18 Feb 2009
    Link to this post
    Hi Anton,

    The template you are referring to is no longer used in 3.6. It was used in HtmlContentEditor.cs, but now you should use ContentItemEdit and ContentItemNew templates.
    All the best,
    Ivan Dimitrov
    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.
  10. Anton Mernov
    Anton Mernov avatar
    110 posts
    Registered:
    03 Dec 2008
    19 Feb 2009
    Link to this post
    Hello Ivan,

    Thanks, it works!

    But then I edit some page there is a block where I placed GenericContent control. Where I can find this template?

    And my filter doesn't work:

    function OnClientLoad(editor, args) 
        { 
           Editor.get_filtersManager().add(new MyFilter()); 
        } 
        MyFilter = function() 
        { 
           MyFilter.initializeBase(this); 
           this.set_isDom(false); 
           this.set_enabled(true); 
           this.set_name("RadEditor filter"); 
           this.set_description("RadEditor filter description"); 
        } 
        MyFilter.prototype = 
        { 
           getHtmlContent : function(content) 
           { 
             content = "test"
             return content; 
           }, 
            
           getDesignContent : function(content) 
           { 
             content = "test"
             return content; 
           } 
        } 
         
        MyFilter.registerClass('MyFilter', Telerik.Web.UI.Editor.Filter); 
     
    I explored Telerik.Web.UI.Editor namespace and has not found Filter class.



    Thanks,
    Anton.
  11. Nikolai
    Nikolai avatar
    216 posts
    Registered:
    01 Jun 2017
    23 Feb 2009
    Link to this post
    Hi Anton,

    Here is the mapping for the external Generic Content Control template:
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.SelectContentDialog"
          <additionalTemplates> 
            <add key="" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/SelectContentDialog.ascx" /> 
            <add key="News" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/SelectContentDialog.ascx" /> 
            <add key="Blogs" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates 
    /News/SelectContentDialog.ascx" /> 
    ..................... 
          </additionalTemplates> 
        </viewSettings> 
     
    Please note that you need to specify key for each of the providers you want to use.
    As for the filters, you will see several filters defined in the control templates, where the RadEditor is defined. Please take an example from there.

    Hope this helps.

    Greetings,
    Nikolai
    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.
  12. Anton Mernov
    Anton Mernov avatar
    110 posts
    Registered:
    03 Dec 2008
    24 Feb 2009
    Link to this post
    Hi Nikolai,

    Thanks for answer!
    I has resolved my problem hereby:

        <viewSettings hostType="Telerik.Cms.Engine.WebControls.Design.GenericContentDesigner, Telerik.Cms.Engine" 
    layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/GenericContentDesigner.sft"
        </viewSettings> 

    As for the filters, I'm sorry but I has forgotten to add OnClientLoad attribute to tag <telerik:RadEditor


    Best regards,
    Anton.
Register for webinar
12 posts, 0 answered