Setting a Minimum Nesting Level in Hierarchical Viewer

Sam Mueller asked on January 19, 2017 16:27

I'm trying to find the logic to change the minimum nesting level in the Hierarchical Viewer.

As an example, I have one parent page and one child page nested to the parent. That child page does not nest and is showing up on the menu in the same column as the parent, unless I make a second child page to the parent.

Current Behavior:     Desired Behavior:

Menu Column 1        Menu Column 1Menu Column 2

  • Parent         Parent  >>>>>>>>>> Child
  • Child            

As you can see, this is what I'm trying to achieve in desired behavior.


With 1 parent, 2 child pages:

Menu Column 1Menu Column 2

Parent  >>>>>>>>>> Child 1
          Child 2

With one parent, two child pages, I get the desired behavior but I have to make an extra page to achieve it. Is there any way to set the minimum nesting level to a one page minimum?

Recent Answers


Brenden Kehren answered on January 19, 2017 16:36

What is your hierarchical menu structure look like. Maybe a screenshot of the transformations page for that main transformation?

0 votesVote for this answer Mark as a Correct answer

Sam Mueller answered on January 19, 2017 16:47

It looks exactly as described above. It uses CMS.MenuItem.MenuItem as its Hierarchical Transformation.

0 votesVote for this answer Mark as a Correct answer

Ilesh Mistry answered on January 19, 2017 17:25 (last edited on January 19, 2017 17:26)

Hi Sam

Are you using the <cms:SubLevelPlaceHolder runat="server" ID="plcSub" /> to help with this by any chance? https://docs.kentico.com/k10/developing-websites/loading-and-displaying-data-on-websites/writing-transformations/using-hierarchical-transformations#Usinghierarchicaltransformations-Settingthelocationofsublevelsintransformations

0 votesVote for this answer Mark as a Correct answer

Sam Mueller answered on January 19, 2017 17:26

Here is an export of the actual web part and options in use:


textWebpart properties (Hierarchical viewer)

Alias path: /
Zone ID: zoneContent


Default


Web part control ID: MainMenu

Web part title: 


Visibility


Visible: True

Hide on subpages: False

{$content.showforpagetypes$}: 

Display to roles: 


Content


Path: /%

Data source name: 


Content filter


Page types: CMS.MenuItem;CMS.Folder

Combine with default culture: 

Culture code: 

Maximum nesting level: -1

ORDER BY expression: 

Select only published: True

Select top N pages: 

Site name: 

WHERE condition: DocumentMenuItemHideInNavigation = 0

Columns: 

Filter out duplicate pages: False

Filter name: 


Hierarchical transformation


Hierarchical transformation: CMS.MenuItem.MenuItem


Transformations



Selected item transfromations


Selected item transformation: 

Selected item header transformation: 

Selected item footer transformation: 


Extended settings


Item separator: 

Hide header & footer for single item: True

Hierarchical display mode: inner


Paging


Enable paging: False

Paging mode: querystring

Pager position: bottom

Page size: 10

Query string key: 

Group size: 10

Display first & last automatically: False

Display previous & next automatically: False

Hide pager for single page: True

Reset scroll position: False


Pager design


Pages: CMS.PagerTransformations.General-Pages

CurrentPage: CMS.PagerTransformations.General-CurrentPage

Page separator: CMS.PagerTransformations.General-PageSeparator

First page: CMS.PagerTransformations.General-FirstPage

Last page: CMS.PagerTransformations.General-LastPage

Previous page: CMS.PagerTransformations.General-PreviousPage

Next page: CMS.PagerTransformations.General-NextPage

Previous group: CMS.PagerTransformations.General-PreviousGroup

Next group: CMS.PagerTransformations.General-NextGroup

Direct page: 

Pager layout: CMS.PagerTransformations.General-PagerLayout


Relationships


Main page: 00000000-0000-0000-0000-000000000000

Main page is on the left side: False

Relationship  name: isrelatedto


System settings


Check permissions: True

Cache item name: 

Cache minutes: 

Cache dependencies: ##DEFAULT##



No data behavior


Hide if no record found: True

No record found text: No data found


Editing buttons


Show New button: False

New button text: 

{$editmode.showeditbutton$}: False

{$editmode.showdeletebutton$}: False


Web part container


Web part container: 

Container title: 

Container CSS class: 

Container custom content: 

Hide container on subpages: False


HTML Envelope


Content before: <nav id="navside">
  <ul id="sidebar-menu">

Content after:  </ul>
</nav>


AJAX


Use update panel: False


Time zones


Time zone: inherit

Custom time zone: 


Performance


Disable view state: False

Disable macros: False

Partial cache minutes: 

Partial cache dependencies: ##DEFAULT##


Preserve partial cache on postback: False


Output filter


Filter output HTML of web part: False

Resolve URLs: True

Fix attributes: True

Fix Javascript: True

Fix lower case: True

Fix self closing tags: True

Fix HTML5: True

Convert TABLE tags to DIV tags: none
0 votesVote for this answer Mark as a Correct answer

Sam Mueller answered on January 19, 2017 17:34

@Ilesh Mistry I'm not using this transformation. How would I go about implementing that and setting the minimum?

0 votesVote for this answer Mark as a Correct answer

Sam Mueller answered on January 19, 2017 17:44

I'm still thinking there is an embedded rule in the web part that prevents nesting unless there is two or more pages.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 20, 2017 16:11

@sam, what I was asking for was something like this

Image Text

If you have the levels set specifically, it won't go any further. Also if you have the sub page placeholders put in place it will automatically go to the next level and apply the transformation(s) as needed/desired. The key is to understanding your levels and where the transformation type gets applied.

0 votesVote for this answer Mark as a Correct answer

Sam Mueller answered on January 20, 2017 16:54

@Brendan

This is my menu transformation:

Image Text

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.