File tree Expand file tree Collapse file tree
Ignia.Topics.Web.Mvc/Controllers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,15 +149,25 @@ public virtual PartialViewResult Menu() {
149149 /// <param name="fromRoot">The distance that the navigation root should be from the root of the topic graph.</param>
150150 /// <param name="defaultRoot">If a root cannot be identified, the default root that should be returned.</param>
151151 protected Topic GetNavigationRoot ( Topic currentTopic , int fromRoot = 2 , string defaultRoot = "Web" ) {
152+
153+ /*------------------------------------------------------------------------------------------------------------------------
154+ | Find navigation root
155+ \-----------------------------------------------------------------------------------------------------------------------*/
152156 var navigationRootTopic = currentTopic ;
153157 while ( DistanceFromRoot ( navigationRootTopic ) > fromRoot ) {
154158 navigationRootTopic = navigationRootTopic . Parent ;
155159 }
156160
161+ /*------------------------------------------------------------------------------------------------------------------------
162+ | Handle default, if necessary
163+ \-----------------------------------------------------------------------------------------------------------------------*/
157164 if ( navigationRootTopic == null && ! String . IsNullOrWhiteSpace ( defaultRoot ) ) {
158165 navigationRootTopic = TopicRepository . Load ( defaultRoot ) ;
159166 }
160167
168+ /*------------------------------------------------------------------------------------------------------------------------
169+ | Return navigation root
170+ \-----------------------------------------------------------------------------------------------------------------------*/
161171 return navigationRootTopic ;
162172
163173 }
You can’t perform that action at this time.
0 commit comments