Skip to main content

How can #nav.hasSubFolders be false across three levels of site structure?

Comments

8 comments

  • Zendesk API User
    Author: rednoss - 8/31/2017 10:07

    Hello Kai,

    I've tested your navigation function inside the Mithras Energy standard project and #nav.hasSubFolders works as expected. Which FirstSpirit Version do you use? I guess you are using a framework for your interactive menu. Can you describe the expected behaviour and look of your navigation?

    Best regards

    Rene

    0
  • Zendesk API User
    Author: kputh - 9/7/2017 14:23

    Hello Rene,

    I use FirstSpirit 5.1.

    The error occurs in a template for a hamburger menu and in another one for breadcrumbs. The hamburger menu should only contain the three or four top-most levels of site structure. Each item in the menu should be 'menu level'/site structure folder. If a folder has sub-folders, its menu item should be expandable with a click. (Like an accordion with more than one level.)

    Sincerely,

    Kai

    0
  • Zendesk API User
    Author: tlegat - 9/7/2017 14:57

    Hi Kai,

    regarding its functionality in one and failure in the other project I wonder what the differences in the projects might be.

    Can you give us an overview of the differences between the two projects?

    Are the templates equal in both projects? No typo e.g.? Do you use feature transport for transfer of the templates?

    You say that it seems that #nav.hasSubFolders is always false. Try outputting it to HTML for debugging (are you able to use the Template Debugger?).

    I know of issues when the contents are not visible. I haven't had a failure on the Boolean itself yet.

    Curious to hear from you,

    Tibor

    0
  • Zendesk API User
    Author: kputh - 9/7/2017 17:31

    Hi Tibor,

    we develop templates in a development project, where the menu and breadcrumbs are correctly generated. Then the templates are exported/imported via feature transport into a testing and staging project, where #nav.hasSubFolders yields unexpected results. The content in both projects originates in a third project, both projects have different version of the content, and it is edited in the testing/staging project for testing purposes.

    I just had a look at the breadcrumbs again and realized two things:

    1. there is an algorithmic error in the template that causes it to skip the lowest-level of structure nodes. This is a very prominent error, as we have many "shallow" top-level structure folders.
    2. in all other cases I can find, there are folders configured to appear in the menu with ancestor-folders configured to not appear in the menu.

    So #nav.hasSubFolders seems to work correctly for the breadcrumbs. I need to examine the menu again with that in mind.

    I never got to use the template debugger.

    Sincerely,

    Kai

    0
  • Zendesk API User
    Author: tlegat - 9/11/2017 14:56

    Hi there,

    so maybe we misunderstood each other:

    - did you check whether the boolean value is correct? It returns true whenever there is a subfolder. It doesn't take visibility checkboxes (content page or structure/menu) into account.

    - regarding lowest level: did you try working with the root parameter instead? We use this to manage multiple sites in the same project.

    Still there seems to be no reason why the above code shouldn't work as expected. Do you use an approval workflow? Are all related structures and contents approved?

    0
  • Zendesk API User
    Author: kputh - 9/12/2017 13:17

    Hi Tibor,

    I didn't check it this thoroughly.

    And I see no advantage in using the root parameter. The breadcrumbs and menu are currently build from the intended root structure node, and I fixed the algorithmic error that caused the omission of the last level of structure folders.

    Sincerely,

    Kai

    0
  • Zendesk API User
    Author: tlegat - 9/12/2017 13:43

    Hey,

    I see. It wasn't quite clear to me if you still have a problem with the algorithm or not.

    Let me know if you find a reason for the menu behavior.

    Sincerely,

    Tibor

    0
  • Zendesk API User
    Author: STrojette - 5/16/2023 10:31

    Sorry the necro, but this issue still isn't fixed in the product.

    Maybe some of you like to support my Feature Request?

    https://community.crownpeak.com/t5/Feature-Discussions/New-nav-hasVisibleSubFolders-Function/idi-p/57513#M3376

    0

Please sign in to leave a comment.