Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>That's quite simple.</p> <p>You could first create an alternate for you MenuWidget like so:</p> <p><strong>Parts.MenuWidget-MyZoneName.cshtml</strong></p> <pre><code>&lt;nav&gt; &lt;div class="logo"&gt; @Html.Partial("_Logo") &lt;/div&gt; &lt;ul&gt; @*Display all the stuff added in the admin*@ @DisplayChildren(Model.Menu) @*Add additional stuff. Of course you could also add it as MenuItem to the Menu-Model*@ @if ( Request.IsAuthenticated ) { if ( Authorizer.Authorize(StandardPermissions.AccessAdminPanel) ) { &lt;li&gt; &lt;a href="/Admin"&gt; Admin &lt;/a&gt; &lt;/li&gt; } &lt;li&gt; &lt;a href="~/Example1"&gt; Extra1 &lt;/a&gt; &lt;/li&gt; } else { &lt;li&gt; &lt;a href="~/Example2"&gt; Extra2 &lt;/a&gt; &lt;/li&gt; } &lt;/ul&gt; &lt;/nav&gt; </code></pre> <p>And then go on and do something similar for your MenuItems. For example:</p> <p><strong>MenuItemLink.cshtml</strong></p> <pre><code>&lt;a href="@Model.Href" class="my-super-cool-custom-link"&gt;@Model.Text&lt;/a&gt; </code></pre> <p>Another thing that's worth mentioning is that you can either only provide an alternate for a specific shape like the MenuItemLink above or just provide an alternate for the base MenuItem shape which will then be used for every MenuItem type that exists.</p> <p>(Maybe those are not the best examples, but I guess they'll do the job ;) )</p> <p><strong>Update</strong>: In order to remove/modify the tags you can create an alternate for MenuItem.cshtml and look at this part:</p> <pre><code>if (HasText(renderedMenuItemLink)) { var tag = Tag(Model, "li"); @tag.StartElement @renderedMenuItemLink if (items.Any()) { &lt;ul&gt; @DisplayChildren(Model) &lt;/ul&gt; } @tag.EndElement } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload