Skip to content

Commit

Permalink
Moved tree menu indent to css
Browse files Browse the repository at this point in the history
  • Loading branch information
fschultz committed Aug 29, 2015
1 parent 3ee56e8 commit 6b9e974
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Assets/Css/DemoSite.css
Expand Up @@ -34,5 +34,6 @@ h1, h2, h3, h4, h5, h6 { font-family: 'Open Sans Condensed', sans-serif; font-we
.products li { padding: 5px 10px; border: 3px solid #e0e0e0; border-radius: 8px; margin-bottom: 10px; background: #f4f4f4; }
.products h2 { margin-top: 0; }
.left-menu { margin-top: 28px; }
.left-menu ul ul { margin-left: 20px; }

.tags { background: #f4f4f4; padding: 5px;}
8 changes: 4 additions & 4 deletions Views/ArticlePage/Index.cshtml
Expand Up @@ -10,7 +10,7 @@

<div class="row">
<div class="left-menu col-lg-3">
@RenderTree(PageFactory.GetPage(Model.CurrentPage.RootId), 0)
@RenderTree(PageFactory.GetPage(Model.CurrentPage.RootId))
</div>
<div class="col-lg-9">
@Model.CurrentPage.TopImage.ToHtml()
Expand All @@ -26,8 +26,8 @@
</div>

@* Recursive function that renders all pages in the current branch which is set to be visible in menus *@
@helper RenderTree(CmsPage page, int marginLeft) {
<ul class="nav nav-pills nav-stacked" style="margin-left:@(marginLeft)px">
@helper RenderTree(CmsPage page) {
<ul class="nav nav-pills nav-stacked">
@* Loop through all children *@
@foreach (CmsPage child in page.Children)
{
Expand All @@ -41,7 +41,7 @@
@if (child.HasChildren && (Model.CurrentPage.ParentPath.Contains(child.PageId) || Model.CurrentPage.PageId == child.PageId))
{
// Only expand selected node
@RenderTree(child, 20)
@RenderTree(child)
}
</li>
}
Expand Down

0 comments on commit 6b9e974

Please sign in to comment.