This project is read-only.

Inserting an Shape on only one page

Topics: Customizing Orchard, Writing themes
Mar 10, 2011 at 10:52 PM


In the Dark theme by bind, I found this line of code in the layout.cshtml file: WorkContext.Layout.Header.Add(New.Top(), "5"); which is adding a top.cshtml file to the header of every page. My question, is there a way within this code to tell it similar to a layer rule, what page to show up on?

TJ Havens

Mar 10, 2011 at 11:00 PM

Sure: put an if statement around that line of code?

Mar 10, 2011 at 11:24 PM

I am not a C# developer, a novice maybe, but no developer, I'm a HTML/CSS Designer... and really like Orchard, can you lend me hand here please...

TJ Havens

Mar 15, 2011 at 1:10 AM

Sure, you can do something like this:

@if (WorkContext.HttpContext.Request.Path.EndsWith("/about", StringComparison.InvariantCultureIgnoreCase)) {