This project is read-only.

Can I use Razor Html.ActionLink in Themes?

Topics: Troubleshooting, Writing themes
Oct 9, 2011 at 4:37 PM

I set up a Theme with, for example, a footer.cshtml that is standard throughout my Orchard site.  I use Html.ActionLink (and even some Html.ImageLink's through a helper), but the links obviously come up Routable/Home/Link.

I would prefer not to use the standard <href> tag, and use the Razor syntax instead but am unsure of how to accomplish this in a Theme folder.  I understand that MVC uses Controllers but it didn't seem something I could use in the Theme folder (unless I am wrong).

Any thoughts on how I might accomplish @HtmlActionLink in my footer.cshtml in the Theme's folder?

Oct 10, 2011 at 9:20 PM

ActionLink or Url.Action are absolutely the way to go. You just need to specify the area in the additional parameters, using the name of the module where the controller is as the area name.