I have combed through the documentation but I could not find what I am looking for. It is possible what I am looking for is not possible, this is new territory to me.
I am using MVCSiteMapProvider for the first time. I need to make sure that search engines can crawl a list of dynamically created pages in my asp.net mvc site.
The view is created based off of two parameter: title and id. The url is spits out is defined in a custom route like this:
routes.MapRoute(
"JobResults", // Route name
"JobSearch/{title}-{id}", // URL with parameters
new { controller = "JobSearch", action = "Job" }, // Parameter defaults
new[] { "MyApp.Web.Controllers" }
);
So when I click on a link it will take me to: localhost:43736/JobSearch/chief-talent-officer-1710
I set up the sitemap plugin and messed with the .sitemap file so it looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<mvcSiteMap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-4.0"
xsi:schemaLocation="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-4.0 MvcSiteMapSchema.xsd">
<mvcSiteMapNode title="Home" controller="Home" action="Index" changeFrequency="Always" updatePriority="Normal">
<mvcSiteMapNode title="About" controller="Home" action="About"/>
<mvcSiteMapNode title="HiringSolutions" controller="Home" action="HiringSolutions"/>
<mvcSiteMapNode title="Privacy Policy" controller="Home" action="Privacy"/>
<mvcSiteMapNode title="Terms" controller="Home" action="Terms" />
<mvcSiteMapNode title="Search" controller="JobSearch" action="Index" changeFrequency="Always" updatePriority="Normal">
<mvcSiteMapNode title="Job" controller="JobSearch" action="Job" changeFrequency="Always" updatePriority="High" route="JobResults"/>
</mvcSiteMapNode>
</mvcSiteMapNode>
</mvcSiteMap>
To see what it comes up with I called this on my index page: @Html.MvcSiteMap().Menu(false, true, true)
. It renders out this:
- Home
- About
- HiringSolutions
- Privacy Policy
- Terms
- Search
How can I get it to do this dynamically?:
- Home
- About
- HiringSolutions
- Privacy Policy
- Terms
- Search
- Job
- /JobSearch/chief-talent-officer-1710
- /JobSearch/another-one-1234
- /JobSearch/another-one-1235
- /JobSearch/another-one-1236
- /JobSearch/another-one-1237
And once I have that (if possible), does this create a sitemap.xml file in the root of my site, or do I need to do something to make that reachable by bots?