Created
April 21, 2015 00:12
-
-
Save mcmullengreg/27785029d3f7250388a2 to your computer and use it in GitHub Desktop.
Global Variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var divider = (i == 2) ? " | " : | |
(i > 2) ? " - " : ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using umbraco.MacroEngines | |
@inherits umbraco.MacroEngines.DynamicNodeContext | |
@{ | |
var pageLevel = @Model.Level; | |
var current = ""; | |
for (var i = pageLevel; i >= 1; i--){ | |
var divider = (i == 2) ? " | " : | |
(i > 2) ? " - " : ""; | |
current += (Model.AncestorOrSelf(i).HasValue("shortPageTitle") && pageLevel != 1) ? Model.AncestorOrSelf(i).shortPageTitle + divider : | |
(Model.AncestorOrSelf(i).HasValue("pageTitle")) ? Model.AncestorOrSelf(i).pageTitle + divider : | |
Model.AncestorOrSelf(i).Name + divider; | |
} | |
var pageTitle = current; | |
} | |
@pageTitle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pageLevel = @Model.Level; | |
var current = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i = pageLevel; i >= 1; i--){ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
current += (Model.AncestorOrSelf(i).HasValue("shortPageTitle") && pageLevel != 1) ? Model.AncestorOrSelf(i).shortPageTitle + divider : | |
(Model.AncestorOrSelf(i).HasValue("pageTitle")) ? Model.AncestorOrSelf(i).pageTitle + divider : | |
Model.AncestorOrSelf(i).Name + divider; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment