I just created a project Razor4Orchard (http://razor4orchard.codeplex.com/), which is a module developed for Orchard (http://orchard.codeplex.com,
RazorEngine (http://razorengine.codeplex.com/) is used to customize richer extensions with C # code on the Orchard page.
You can directly paste the *. cshtml code to the page after the test is passed in the asp.net mvc3 project.
How to use:
1. Install the Razor4Orchard module:
Download orchard.module.raisingstudio.razor.1.0.nupkg (http://razor4orchard.codeplex.com/releases/view/65649#DownloadId=235625) from http://razor4orchard.codeplex.com)
2. Create Razor Page:
3. view results:
4. Add widgets:
In Razor4Orchard, Razor widgets, Razor Part, and Razor Field are provided for custom Content types and page la S.
5. Compile the Razor Template content in the Widget:
6. Go back to the home page and view the results directly:
Sample Code:
@{ var userid = 0; var username = string.Empty; if(Model.Services.WorkContext.CurrentUser != null) { userid = Model.Services.WorkContext.CurrentUser.Id; username = Model.Services.WorkContext.CurrentUser.UserName; }}Hello <a href="/OrchardLocal/Admin/Users/Edit/@userid">@username</a>
Address: http://razor4orchard.codeplex.com/
Orchard Gallery download: Orchard. Module. RaisingStudio. Razor