Arjan cozzmoz

View GeneralProperties.cshtml
1 2 3 4 5 6 7 8 9 10
@inherits RenderViewPage
@using Umbraco.Cms.Web;
 
<h2>Built in Properties</h2>
<h4>Common</h4>
<p>
<strong>@@DynamicModel.Name</strong><br/>
@DynamicModel.Name
</p>
<p>
View gist:2127377
1 2 3 4 5 6 7 8 9 10
@inherits PartialViewMacroPage
@using Umbraco.Cms.Web
@using Umbraco.Cms.Web.Macros
@using Umbraco.Framework
 
 
@* Ensure that the Current Page has children, where the property umbracoNaviHide is not True *@
@if (DynamicModel.Children.Where("umbracoNaviHide != @0", "True").Any())
{
@* Get the first page in the children, where the property umbracoNaviHide is not True *@
View gist:2127368
1 2 3 4 5 6 7 8 9
@inherits PartialViewMacroPage
@using Umbraco.Cms.Web
@using Umbraco.Cms.Web.Macros
@using Umbraco.Framework
 
@{
@* Get the content type alias we want to filter on from the macro parameter *@
var contentTypeAlias = Model.MacroParameters.contentTypeAlias;
}
View gist:2127367
1 2 3 4 5 6 7 8 9 10
@inherits PartialViewMacroPage
@using Umbraco.Cms.Web
@using Umbraco.Cms.Web.Macros
@using Umbraco.Framework
 
 
@* Ensure that the rootNode has children, where the property umbracoNaviHide is not True *@
@if(DynamicModel.Children.Where("umbracoNaviHide != @0", "True").Any())
{
<ul>
View gist:2127359
1 2 3 4 5 6 7 8 9
@inherits PartialViewMacroPage
@using Umbraco.Cms.Web
@using Umbraco.Cms.Web.Macros
@using Umbraco.Framework
 
@{
@* Walk up the tree from the current page to get the root node *@
var rootNode = DynamicModel.AncestorsOrSelf.Last();
}
View gist:2127355
1 2 3 4 5 6 7 8 9 10
//Order by Node Name
@foreach (Content child in Model.ChildContent().OrderBy(x => x.Name))
{
<h2>@child.Name</h2>
}
 
//Order by custom property on node with alias of 'pageTitle'
@foreach (Content child in Model.ChildContent().OrderBy(x => x.Field("pageTitle")))
{
<h2>@child.Name</h2>
View NewsFeed.cshtml
1 2 3 4 5 6 7 8 9 10
@*
================= Credit goes to Jorge Lusar for creating this =================
Original's at: https://gist.github.com/jorgelusar
 
 
Parameters
FeedItems (int, optional, default 20, number of items to be displayed)
FeedTitle (string, optional, default domain name, the title of the feed)
FeedDescription (string, optional, default domain name, the description of the feed)
Author (string, optional, default 'admin', the author name or website name to ensure the atom feed is valid)
View SitemapHTML.cshtml
1 2 3 4 5 6 7 8 9 10
@inherits PartialViewMacroPage
@using Umbraco.Cms.Web
@using Umbraco.Cms.Web.Macros
@using Umbraco.Framework
 
@{
//Get the current page
var currentPage = DynamicModel;
 
//Will walk up the tree to the last ancestor node aka RootNode
View ListChildPagesFromCurrentPage.cshtml
1 2 3 4 5 6 7 8 9 10
@inherits PartialViewMacroPage
@using Umbraco.Cms.Web
@using Umbraco.Cms.Web.Macros
@using Umbraco.Framework
 
@* Check we have child pages *@
@if (DynamicModel.Children.Any())
{
<nav id="subnavi">
<ul>
View ListChildPagesFromChangeableSource.cshtml
1 2 3 4 5 6 7 8 9
@inherits PartialViewMacroPage
@using Umbraco.Cms.Web
@using Umbraco.Cms.Web.Macros
@using Umbraco.Framework
 
@{
@* Get the macro parameter and check it has a value otherwise set to empty hive Id *@
var startNodeID = String.IsNullOrEmpty(Model.MacroParameters.startNodeID) ? HiveId.Empty.ToString() : Model.MacroParameters.startNodeID;
}
Something went wrong with that request. Please try again.