>("PropertyWithPicker"); }
-
- @foreach (var id in selection)
- {
- var item = Umbraco.Content(id);
- -
- @item.Name
-
- }
-
\ No newline at end of file
+@if (selection.Any())
+{
+
+ @foreach (var item in selection)
+ {
+ -
+ @item.Name
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml
old mode 100644
new mode 100755
index f2a4920a12..cc616c48b0
--- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml
+++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml
@@ -6,13 +6,16 @@
It also highlights the current active page/section in the navigation with the css class "current".
*@
-@{ var selection = CurrentPage.Site().Children.Where("Visible"); }
+@{ var selection = Model.Content.Site().Children.Where(x => x.IsVisible()); }
-
- @foreach (var item in selection)
- {
- -
- @item.Name
-
- }
-
+@if (selection.Any())
+{
+
+ @foreach (var item in selection)
+ {
+ -
+ @item.Name
+
+ }
+
+}
diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml
old mode 100644
new mode 100755
index 0aef1eb3a4..219837da78
--- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml
+++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml
@@ -7,7 +7,7 @@
- It uses a custom Razor helper called Traverse() to select and display the markup and links.
*@
-@{ var selection = CurrentPage.Site(); }
+@{ var selection = Model.Content.Site(); }
@* Render the sitemap by passing the root node to the traverse helper, below *@
@@ -15,14 +15,14 @@
-@* Helper method to travers through all descendants *@
-@helper Traverse(dynamic node)
+@* Helper method to traverse through all descendants *@
+@helper Traverse(IPublishedContent node)
{
@* Update the level to reflect how deep you want the sitemap to go *@
var maxLevelForSitemap = 4;
@* Select visible children *@
- var selection = node.Children.Where("Visible").Where("Level <= " + maxLevelForSitemap);
+ var selection = node.Children.Where(x => x.IsVisible() && x.Level <= maxLevelForSitemap);
@* If any items are returned, render a list *@
if (selection.Any())