Newly created template is based on itself? - General Discussions - General Discussions - Progress Community
 General Discussions

Newly created template is based on itself?

  • Newly created template is based on itself?
  • Hi,
    I'm currently trying to creating a template based on a Master Page (Base.Master).

    I attempt to create the template "<Project>BaseTemplate" and it creates a Draft template of this name but instead of being based on the Base.Master file that I selected, it creates another draft template called "Base" and bases it on this template. The draft template "Base" is then based on Base.Master.

    Does anybody know why it is creating this extra template as they are both the same?

    Thanks,
    Paul
  • Hello,

     I have tried to reproduce this on Sitefinity 4.4 so I can better advise you why this is happening. The steps tested are:
    1.Create new template
    2. Base the new template on another template
    3. No draft have been created, the "Base on template column in the templates grid was filled with the template I selected"

    Can you elaborate on the steps a little more of I have misunderstood them?

    Kind regards,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Hello,

    The exact steps I'm taking to do this in 4.4 are:

    1. Create "Base.Master" in Visual Studio
    2. Create "Section.Master" in Visual Studio as a Nested Master Page on Base.Master
    3. Create new draft template "<Proj>BaseTemplate" (this is to be used to add controls into the header). At this time a new draft template "Base" which is based on the master page Base.master is created and the template is based on this.
    4. Also create new draft Template "<Proj>SectionTemplate" which is to be used to base a series of Pages on. At this time a new draft template "Section" which is based on the master page Section.master is created and the template is based on this.

    I'm using a workaround to get around this at the moment by deleting the templates <Proj>SectionTemplate and <Proj>BaseTemplate then renaming Section to <Proj>SectionTemplate and Base to <Proj>BaseTemplate.
  • In a further update to this I now have a new problem whereby every time I'm creating a new template and selecting a master page for that template, it is instead linked to another template that is based on that master page instead of being created directly on the master page itself.

    I don't want to create my new template on another template, I want to create it on the Master Page, anyone know why the create template procedure let me do this.

    Any help much appreciated...
  • Hello,

     I have tried the steps mentioned the way I interpret them might be different tough. I create two master pages one is standard and teh other is nested master page. I create new template with the base master file and teh template is called "A". Then create new tempalte "B" with the nested master page file. I don`t select the option base on template and all is running fine.

    Greetings,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Hi,
    I'm still getting this problem when I create a new template or change one in that it creates it on itself or on an existing one rather than the Master Page.

    What I have noticed in the database table sf_page_templates is that the field 'prent_template_id' is being set to a GUID value, (I'm assuming this is a parent template value) and the Master Page field is not set.

    I've tried to hack this but cannot remove the GUID entry and it seems to override the Master page entry in the field.

    Regards,
    Paul
  • Hi Again,

    Ok, I've managed to hack the database table to get this to function correctly. I made sure I set the GUID to NULL and gave gave the page a Title.

    Paul
  • Cancel that,

    The page keeps resetting itself in Sitefinity so that it isn't based on any template anymore and I have to keep selecting a new one in "Page Templates". As soon as I do it will not choose the actual master page, instead it always selects the template that is already based on that Master Page I choose.

    This isn't ideal but I'm just going to use it like this and change the Theme.
  • 334866_master-01.png
    Ok here is what has happened to me.

    I created a .master file in VS uploaded it to the server build the site and uploeded the dll.
    I deleted all standard templates but one (I guess thats not important)
    I selected create template and did choose my .master file from App_Master
    I did pull a content block into one of the place holder but saw that I had some DIV hidden from CSS so I deleted the content block and saved the template. (master_01.png)

    I ended up with mymaster (which is the name of the master file mymaster.master) as well as the Master Template which I wanted to base on mymaster.master.
    Sp the real .master file was shown in templates and based on itself.

    www.marktold.com/screencast/master.swf

    I reproduced it by using going back to templates instead of saving.

    I think thats another queen song :-)
    Markus
  • Ryan will come with the answer in the next post :-)
    Markus
  • I have ran into the same exact problem.  The reason (in my case) that this was happening was because I had no default template set.  I didn't have one set because I had deleted out all the stock templates to start with a clean instance.  This of course will cause you to not have a default template.
    The fix:
    Create a template and select "Don't use template (start from scratch)."  Go ahead and publish this template.  Now create another template and base it off of the template you built from scratch but BE SURE to check the "Use the selected template as a default template when you create a new page" checkbox.  Now you have a default template set.  From here you can go ahead and create your template based off of your master page.  Once that is complete you can delete out the other two you created.

    Hope this works for you.
    Ryan
  • @Ryan
    100% correct. Once I did set the remaining template I had as default this would not happen. Telerik should award you some points for this.

    The difference was that I did delete all but one of the default templates before creating my own. And I probably usual left the default default template in the other projects.

    @Telerik
    Please look into this. I only use the default templates for placeholder till the real page is up. So everyone working the same way might run into trouble if they delete the default templates before creating their own.

    Markus
  • Sorry might have posted in error.

    Markus
  • The problem still exists in 5.4

    If you want to create a new template from a .master and you have not set any other template to be used as default, Sitefinity will create two templates.

    You need to have a template set as default to create your own template from .master correctly.

    @Telerik

    Is there a PITS for this?

    Markus