Umbraco & Razor: If CurrentPage/Model is a Child, condition -


My navigation / node structure is as follows:

Home
- About Us
- Our services ----- Finance ----- Insurance -

Lies my current code through nodes and lists them in one. When there are children on 'Current Page', children are included in the menu.

The problem with this loop is that when a child (finance or insurance) is the 'current page', then 'if' condition fails in 'our services' node because currently the child is now on the page Not so, therefore 'finance' and 'insurance' will now remain in the menu.

I want to 'if', '' I have to add ''

   gt;  

The code given below

@ourch (@nantpage on var page. Unstourself (1) children.) {& Lt; Li class = "menu itts @ (page.instore and (current page)?" Selected ": blank) & gt; & Lt; A href = "@ page.Url" & gt; @ PageName Testing & lt; / A & gt; & Lt; / Li & gt; {(Current page) • "selected" child ("current page"). "Selected page child". (Count)> (foreach (various child pages in page. Children) {

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -