Where does RegisterControlTemplate store info? - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Where does RegisterControlTemplate store info?

  • Where does RegisterControlTemplate store info?
  • The call to RegisterControlTemplate install method of the products module seems to be duplicating templates(I added a virtual path which probably broke it). Where is this data stored so I can go through and clean it out?

    I modified the method like this which probably caused the issue. I just need to know how to correct it.
    initializer.RegisterControlTemplate("~/sfproducts/" + MasterListView.titlesOnlyLayoutTemplateName, typeof(MasterListView).FullName, ProductsDefinitions.FrontendTitlesOnlyListViewName);

    I can see that it probably has the following fields, but I'm not seeing the table
    // Properties
        [DataMember, FieldAlias("areaName")]
        public virtual string AreaName get; set;
        [FieldAlias("condition"), DataMember]
        public virtual string Condition get; set;
        [FieldAlias("control"), NonSerializableProperty]
        public virtual ControlData Control get; set;
        [FieldAlias("controlType"), DataMember]
        public virtual string ControlType get; set;
        public override string Data get; set;
        [DataMember, FieldAlias("embeddedTemplateName")]
        public virtual string EmbeddedTemplateName get; set;
        [Sortable("Widget type"), DataMember, FieldAlias("friendlyControlName")]
        public virtual string FriendlyControlName get; set;
        [DataMember, FieldAlias("isDifferentFromEmbedded")]
        public virtual bool IsDifferentFromEmbedded get; set;
        [DataMember, FieldAlias("resourceAssemblyName")]
        public string ResourceAssemblyName get; set;
        [FieldAlias("resourceClassId"), DataMember]
        public virtual string ResourceClassId get; set;
  • sf_presentation_data
  • Hello,

    I would suggest that you do not work with the database tables directly. There are references to the IDs of the presentation data in other tables, which is a risk to breaking the site. Instead it the API should be used. A sample of how to get a control template, and manipulate through API:
    var templates = PageManager.GetManager().GetPresentationItems<ControlPresentation>().Where(cP => cP.ControlType.Contains("YourControlType"));
    foreach (var template in templates)
        //do something

    Kind regards,
    Radoslav Georgiev
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
  • I must have honestly not been too confident in the template api of sitefinity at that point. Additionally I had a team that couldnt continue key development until we found out if the templates were going to work. Sometimes, in times of urgency, you have to backup your db and begin experimenting to keep your team moving. Thankfully I didnt break anything and our team was able to continue developing over the weekend. I used sql delta to replace the old data and deleted the code in the manner you suggested when you sent us this code block yesterday. This should help anyone else that is having issues with rogue/duplicated control templates. We have logged it to our library.
    Thanks again