I have an odd situation that's more than a little concerning. Nodes built on child document types which have had template changes do not seem to apply the changes until each node is published individually.
I have three document types:
- Site Page -- Event -- News Article
Each of these document types was allowed templates called "two-column page" and "one-column page". Each of these had the following logic in the template:
Some content was created on the site using the "site page" document type, with multiple child nodes of the "event" and "news article" types.
Then I needed to create a new template called "basic page", and introduced some logic into the template to check for the existence of the "hideSidebar" property first:
I went into each of my document types and updated their default template to "basic page" and removed "one-column page" and "two-column page" from the allowed templates.
The problem is, pages built on the "Site Page" doc type work fine. But pages built on the "News Article" or "Event" doc types are broken - because they are still using the "two-column page" template despite my removing it as an option.
I know this because of the error message I see displayed. Note the last line which displays the current template used, it specifies the old template and not the new one.
Input string was not in a correct format.
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.FormatException: Input string was not in a correct format.
Source Error:
Line 12: <umbraco:Macro Alias="SubNav" homeDocumentType="SiteHomepage" runat="server"></umbraco:Macro>
Line 13: <!-- Optional sidebar content -->
Line 14: <% if (int.Parse(umbraco.NodeFactory.Node.GetCurrent().GetProperty("hideSidebar").Value) != 1) { %>
Line 15: <umbraco:Item Field="sidebarContent" recursive="true" insertTextBefore="<aside class="sidebar">" insertTextAfter="</aside>" runat="server"></umbraco:Item>
Line 16: <% } %>
I am able to apply the doc type change by republishing each node one at a time, but publishing the parent and the 'republish entire site' do nothing. Also recycling the app pool (IIS 7) and restarting the website do nothing.
This is a major problem as this site will potentially have tens of thousands of nodes.
Changing default template in child document types
I have an odd situation that's more than a little concerning. Nodes built on child document types which have had template changes do not seem to apply the changes until each node is published individually.
I have three document types:
- Site Page
-- Event
-- News Article
Each of these document types was allowed templates called "two-column page" and "one-column page". Each of these had the following logic in the template:
Some content was created on the site using the "site page" document type, with multiple child nodes of the "event" and "news article" types.
Then I needed to create a new template called "basic page", and introduced some logic into the template to check for the existence of the "hideSidebar" property first:
I went into each of my document types and updated their default template to "basic page" and removed "one-column page" and "two-column page" from the allowed templates.
The problem is, pages built on the "Site Page" doc type work fine. But pages built on the "News Article" or "Event" doc types are broken - because they are still using the "two-column page" template despite my removing it as an option.
I know this because of the error message I see displayed. Note the last line which displays the current template used, it specifies the old template and not the new one.
I am able to apply the doc type change by republishing each node one at a time, but publishing the parent and the 'republish entire site' do nothing. Also recycling the app pool (IIS 7) and restarting the website do nothing.
This is a major problem as this site will potentially have tens of thousands of nodes.
Someone help please!!!
I have some updated information if can be useful to anyone who wishes to help me...
Here is the content of the cmsTemplate table:
Here is the content of the cmsContentType table:
Here is the content of the cmsDocumentType table:
is working on a reply...