XML Sitemap in Sitefinity 6
How do you generate an XML Sitemap in Sitefinity 6? I see there was a control you could download for versions 4 and 5 (enterprisefinity.com/.../sitemap-generator), but it is not available for 6.
I believe there's an SDK sample which generates one too
I use that generator on version 6.X all you need to do is add these assembly binding redirects.
<
runtime
>
<
assemblyBinding
xmlns
=
"urn:schemas-microsoft-com:asm.v1"
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"Telerik.Sitefinity"
publicKeyToken
=
"b28c218413bdf563"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-65535.65535.65535.65535"
newVersion
=
"6.1.4300.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"Telerik.Sitefinity.Model"
publicKeyToken
=
"b28c218413bdf563"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-65535.65535.65535.65535"
newVersion
=
"6.1.4300.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"Telerik.Web.UI"
publicKeyToken
=
"121fae78165ba3d4"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-65535.65535.65535.65535"
newVersion
=
"2013.1.417.40"
/>
</
dependentAssembly
>
<!--For Sitemap Generator-->
<
dependentAssembly
>
<
assemblyIdentity
name
=
"Telerik.Sitefinity.Utilities"
publicKeyToken
=
"b28c218413bdf563"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-65535.65535.65535.65535"
newVersion
=
"6.1.4300.0"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"Telerik.OpenAccess.Runtime"
publicKeyToken
=
"7ce17eeaf1d59342"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-2013.2.611.1"
newVersion
=
"2013.2.611.1"
/>
</
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"Telerik.OpenAccess"
publicKeyToken
=
"7ce17eeaf1d59342"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-2013.2.611.1"
newVersion
=
"2013.2.611.1"
/>
</
dependentAssembly
>
</
assemblyBinding
>
</
runtime
>
Hi,
We have created a feature request. You could find its description and vote for its popularity on the following URL. When planning releases, we are always going through the feature requests in PITS and taking decision based on votes.
Regards,
Stefani Tacheva
Telerik
There is a useful sample in the Sitefinity Toolkit and a helpful blog entry here
A second example you can find in the SDK which has a sample for a Sitemap module.
When retrieving pages the api delivers all pages. Also if you have a multisite environment.
For that you can use some code like that to get the root node of your site:
// get the correct site
MultisiteContext mc =
new
MultisiteContext();
ISite site = mc.CurrentSite;
// get the id of the root site
Guid rootId = site.SiteMapRootNodeId;
// append pages to the sitemap
// get a page manager
PageManager pageManager = PageManager.GetManager();
// get the pages
IQueryable<PageData> pages = pageManager.GetPageDataList().Where(pData => pData.Status == ContentLifecycleStatus.Live);
foreach
(var page
in
pages)
if
(page.NavigationNode.RootNodeId == rootId)
....
Hello,
Thank you for sharing a solution. Your feedback is much appreciated. I will make sure that it is forwarded.
Regards,
Stefani Tacheva
Telerik
Hello,
I added that code to my web.config in my sitemap module sample but i am having error, my version is 6.3.
I am i doing something wrong?
Hi Mo,
XML Sitemap functionality is now available out-of-the-box and I would recommend you to upgrade your project to the latest Sitefinity version following that article..
Regards,
Svetoslav Manchev
Telerik
Company policies, an upgrade is not happening till sometime next year.
For now custom code is my only choice, and i need help.
Thank you
Hi,
In that case you can try this sample available in Sitefinity SDK in Git hub:
Telerik.Sitefinity.Samples.Sitemap (get the release version you need)
Note that this is not compatible with the build-in one, so once you upgrade you can remove that project sample and use the out-of-the-box one.
I hope the information above was useful.
Regards,
Svetoslav Manchev
Telerik
I already downloaded the Telerik.Sitefinity.Samples.Sitemap for y version 6.3,
Do i add the whole Telerik.Sitefinity.Samples.Sitemap folder in my project or i should just take the Module folder which contain the sitemap folder into my project?
Which files should i edit for it to work for my site?
thank you
Hello,
You can find instructions how to install the project samples in that article.
I hope this information helps.
Regards,
Svetoslav Manchev
Telerik
I did the following as instructed
### Installation instructions: SDK Samples from GitHub
1. In Solution Explorer, navigate to _SitefinityWebApp_ » *App_Data* » _Sitefinity_ » _Configuration_ and select the **StartupConfig.config** file.
2. Modify the **dbType**, **sqlInstance** and **dbName** values to match your server settings.
3. Build the solution
To login to Sitefinity backend, use the following credentials:
**Username:** admin
**Password:** password
I had few errors then i fixed them, build the solution. Run the code Server Error in '/' Application.
Hello Mo,
The error provided means that the projects versions are different - for example your project is internal build of 6.3.50xx, as the sample is for the major version (6.3.5000). You can check here what is your exact 6.3 version. In case of different versions, you can try on a backup copy to upgrade the sample project from Sitefinity 6.3.5000 to the internal build you have. Here are the steps you can take to do this on your side:
- Update-package Telerik.Sitefinity.Content -Version 6.3.50xx.0 -Source nuget.sitefinity.com/nuget
- Update-package Telerik.Sitefinity.Core -Version 6.3.50xx.0 -Source nuget.sitefinity.com/nuget
7. Please note that there’s no need to update the Data Access packages as the internal build uses the same version.
Clear the NuGet cache files. To do this:
a) In Windows Explorer, open the %localappdata%\NuGet\Cache folder.
b) Select all files and delete them.
8. Build the solution.
I hope this helps.
Regards,
Thanks for your help.
I download a Sitefinity 6.3.zip file, followed the instructions.
On Open Package Manager Console, it fails to update. Saying " No update available for Update-package Telerik.Sitefinity.
Instruction 5 and 6 fail. Snap Shot attach
Thanks for your effort
Hello Mo,
Do you have any error now when you run your project? Is it still the one you have before?
If so you can check the references to Telerik.Sitefinity.dll, readd it if needed or add a Binding redirect to your assembly version.
Regards,
Svetoslav Manchev
Telerik
Hi Mo,
Can you open a support ticket in order to inspect your project more detailed. Once you have the solution, you can share it with the community.
Regards,
Svetoslav Manchev
Telerik