Created
November 12, 2013 20:22
-
-
Save aolde/7437996 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These urls work: | |
- /News-Search/TechForum/Stockholm/ | |
- /News-Search/TechForum/ | |
- /News-Search/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routes.MapContentRoute( | |
name: "Search", | |
url: "{language}/{node}/{event}/{location}/{action}", | |
defaults: new { action = "Index", @event = UrlParameter.Optional, location = UrlParameter.Optional }, | |
parameters: new MapContentRouteParameters { | |
Constraints = new { node = new ContentTypeConstraint<SearchPage>(matchInheritedTypes: true) } | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SearchController : PageController<SearchPage> | |
{ | |
public ActionResult Index(SearchPage currentPage, string @event, string location) | |
{ | |
return Content(string.Format("{0}: {1} in {2}", currentPage.PageName, @event, location)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ContentType(GUID = "3FE318E2-2522-4949-914C-2B44B2C6EE55", DisplayName = "Search Page", GroupName = "Content")] | |
public class SearchPage : PageData { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment