Umbraco version 7.1.4, Seo Checker version 1.5.2 Situation: setting "Enable XmlSitemap" property in SEO confuguration generates an empty xml. What can be wrong here?
The exclude in sitemap option is clear and http handler is configured. However, at this project we are using custom controller/model implementation ... so we don't create umbraco templates in umbraco admin (Settings->Templates) but rather use document type alias to map to the appropriate template under mvc website. So I made an experiment and defined a template via umbraco admin ... and that content item appeared in the sitemap :) Any ideas how we can make it work for our design?
Hmm Good question. The reason the template check exists is because in other situations that will result in an empty page. But in your situation it needs to look a bit further. This won't be an easy 5 minutes fix but I will look what I can do for a next release to support this scenario. What you can do as a workaround maybe is to create a dummy template for now and assign that to the doctypes you use for route hijacking?
No luck ... as soon as I specify a default template explicitly umbraco starts using it paying no attention to our custom model and even if to uncheck this template from "Allowed templates" the template is still used ... clearing cache, temporary internet files, etc. has no effect and if then to try to delete the template the following exception is thrown:
Failed to delete item 1093 Error running NonQuery: SQL Statement: delete from cmsTemplate where NodeId =1093 Exception: System.Data.SqlServerCe.SqlCeException (0x80004005): The primary key value cannot be deleted because references to this key still exist. [ Foreign key constraint name = FK_cmsDocument_cmsTemplate_nodeId ] at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr) at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor) at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options) at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery() at SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)
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: SqlCE4Umbraco.SqlCeProviderException: Error running NonQuery: SQL Statement: delete from cmsTemplate where NodeId =1093 Exception: System.Data.SqlServerCe.SqlCeException (0x80004005): The primary key value cannot be deleted because references to this key still exist. [ Foreign key constraint name = FK_cmsDocument_cmsTemplate_nodeId ] at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr) at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor) at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options) at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery() at SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)
Stack Trace:
at SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters) at SqlCE4Umbraco.SqlCEHelper.ExecuteNonQuery(String commandText, SqlCeParameter[] parameters) at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters)
Only deleting the document types which the template was assigned helps... well, but this is another bug related to umbraco )). Looks like we will have to implement our own site map generation handler unless the behaviour is fixed in SEO Checker.
Sorry you ran into issues using the template. I've just seen that it is possible to read the route table. I'm curious how that looks on your end. Would it be possible to contact me via [email protected] then we can go back and forth on this one to support Route Hijacking as well.
I have implemented sitemap generator as a surface controller which accepts a language parameter. For undefined or english language it outputs english nodes, for other language - only those belonging to that very language. In SEO Checker -> settings -> domain settings I have 2 nodes: these are home pages for different locales (english and dutch), see mapping below:
For each domain robots.txt file I specified the Sitemap path:
for default (en) locale: http://{HTTP_HOST}/umbraco/surface/sitemapxml/Index/ - outputs all pages for english home page and its descendants
for dutch (nl) locale: http://{HTTP_HOST}/umbraco/surface/sitemapxml/Index?language=nl - outputs all pages for dutch home page and its descendants
My questions are:
Is the way of generating site map for different locales OK with perspective to SEO Checker?
How can I make sure that Robots.txt file is unique for each site (I cant't see it physically...)?
Yes you can do both. The xml sitemap should be rendered based on rootnode out of the box, but since you are using your own controller you can modify the robots.txt settings. Right click on the rootnode and then select edit robots.txt file should help you.
SEO Checker does not generate an xml site map
Umbraco version 7.1.4, Seo Checker version 1.5.2
Situation: setting "Enable XmlSitemap" property in SEO confuguration generates an empty xml. What can be wrong here?
Hi,
Propably the exclude in sitemap option is checked on the root document type node and otherwise check if the httphandler is configured in web.config.
Hope this helps,
Richard
Hi Richard,
The exclude in sitemap option is clear and http handler is configured. However, at this project we are using custom controller/model implementation ... so we don't create umbraco templates in umbraco admin (Settings->Templates) but rather use document type alias to map to the appropriate template under mvc website. So I made an experiment and defined a template via umbraco admin ... and that content item appeared in the sitemap :) Any ideas how we can make it work for our design?
Hi Andrei,
Hmm Good question. The reason the template check exists is because in other situations that will result in an empty page. But in your situation it needs to look a bit further. This won't be an easy 5 minutes fix but I will look what I can do for a next release to support this scenario. What you can do as a workaround maybe is to create a dummy template for now and assign that to the doctypes you use for route hijacking?
Best,
Richard
Hi Richard,
No luck ... as soon as I specify a default template explicitly umbraco starts using it paying no attention to our custom model and even if to uncheck this template from "Allowed templates" the template is still used ... clearing cache, temporary internet files, etc. has no effect and if then to try to delete the template the following exception is thrown:
Failed to delete item 1093Error running NonQuery: SQL Statement: delete from cmsTemplate where NodeId =1093 Exception: System.Data.SqlServerCe.SqlCeException (0x80004005): The primary key value cannot be deleted because references to this key still exist. [ Foreign key constraint name = FK_cmsDocument_cmsTemplate_nodeId ]
at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
at SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)
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: SqlCE4Umbraco.SqlCeProviderException: Error running NonQuery: SQL Statement: delete from cmsTemplate where NodeId =1093 Exception: System.Data.SqlServerCe.SqlCeException (0x80004005): The primary key value cannot be deleted because references to this key still exist. [ Foreign key constraint name = FK_cmsDocument_cmsTemplate_nodeId ]
at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
at SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)
Stack Trace:
at SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)
at SqlCE4Umbraco.SqlCEHelper.ExecuteNonQuery(String commandText, SqlCeParameter[] parameters)
at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters)
Only deleting the document types which the template was assigned helps... well, but this is another bug related to umbraco )). Looks like we will have to implement our own site map generation handler unless the behaviour is fixed in SEO Checker.
Hi Andrei,
Sorry you ran into issues using the template. I've just seen that it is possible to read the route table. I'm curious how that looks on your end. Would it be possible to contact me via [email protected] then we can go back and forth on this one to support Route Hijacking as well.
Best,
Richard
Hi Richard,
Route hijacking shouldn't be the problem. We have project that uses route hijacking and the site map works just fine.
Dave
Hi Dave,
Did you assign templates there? That is the issue your colleague is having now.
Best,
Richard
Yep... al my doctypes have templates
Hi Richard!
I have implemented sitemap generator as a surface controller which accepts a language parameter. For undefined or english language it outputs english nodes, for other language - only those belonging to that very language. In SEO Checker -> settings -> domain settings I have 2 nodes: these are home pages for different locales (english and dutch), see mapping below:
For each domain robots.txt file I specified the Sitemap path:
Hi,
Yes you can do both. The xml sitemap should be rendered based on rootnode out of the box, but since you are using your own controller you can modify the robots.txt settings. Right click on the rootnode and then select edit robots.txt file should help you.
Hope this helps,
Richard
is working on a reply...