When Feather is installed Details and Index controller actions have a special meaning. Index action acts as Master in a Master/Detail scenario; Details displays one specific item based on the URL. All content in Sitefinity CMS has UrlName. Some content data providers also define a specific URL format that dictates how items' URLs are generated, relative to the page where the content widget is placed. For example, news items have publication date placed before the UrlName segment of the URL. This article describes how Feather can resolve the requested item in the most consistent way.
Index action with first parameter of type int? will be invoked when the current URL has one integer after the page URL. This is an exception to the default routing of the MVC widgets where you have to add a URL segment with the action name before its parameters. You use this route for paging in the following way:
public ActionResult Index(int? page)
Details action with first parameter of type that implements Telerik.Sitefinity.Model.IDataItem will be invoked when the URL of the page matches the URL of an item of the specified type. Use the following code:
public ActionResult Details(NewsItem newsItem)
The action above will be invoked when the URL of the News item matches the current URL. Feather passes that item as a parameter to the action. Optionally, your action can have a second parameter string redirectUrl. If the current URL is one of the additional URLs of the item, Feather passes the default URL of the item and it is set to redirect to the default one.
For dynamic modules, the action look in the following way:
public class AuthorController : Controller
public ActionResult Details(DynamicContent author)
By convention, Feather searches for dynamic content with the name of the controller. In this case - Author. Because namespace is disregarded, in case of multiple Author dynamic content types, the first active module is taken.
Back To Top