In EPiServer CMS 7, a Content Area can be tagged with one or more Tags:
@Html.PropertyFor(x => x.CurrentPage.MainContent, new { Tag = "ContentTag" })
One way you can wire up Page Types and Tags to create a controller with a TemplateDescriptor
attribute:
[TemplateDescriptor(
TemplateTypeCategory = TemplateTypeCategories.MvcPartialController,
Default = true,
Tags = new[] { "ContentTag", "SecondTag" }
)]
public class SitePageDataController : PageController<SitePageData>
{
public ActionResult Index(SitePageData currentContent)
{
return View(currentContent);
}
}
In the above example, the SitePageDataController could have been chosen due to two tags. Is there any way to find out at runtime which tag resulted in the current controller being chosen?
Is their an API I can call in my controller action which will get me the tag?