Docfx: Main nav bar does not collapse when items are added to the dropdown

Created on 22 Mar 2018  路  14Comments  路  Source: dotnet/docfx

DocFX Version Used: 2.32.2

Template used: (default or statictoc or contain custom template) default + custom

Steps to Reproduce:

  1. Add dropdown items to the main nav bar
- name: Guides
  href: articles/
- name: API
  items:
  - name: REST API
    href: restapi/
  - name: Plugins
    href: obj/api/

Expected Behavior: In this example, the nav bar would expand when you hover over "API"

Actual Behavior: The "dropdown" items are permanently stacked in an open position

2018-03-22 16_43_46-microsoft edge

Thank you.

Area-Themes help-wanted

Most helpful comment

I've written a basic fix here. The Readme provides the steps to fix the issue in a blank project, so should be portable to other projects as it only modifies a copy of the default DocFX template.

All 14 comments

Yes, currently only 1 level navbar is supported....... Need css/js/html update to support deeper levels.

Thank you @vicancy

Is there an eta for fixing it please? :-)

I've written a basic fix here. The Readme provides the steps to fix the issue in a blank project, so should be portable to other projects as it only modifies a copy of the default DocFX template.

@ollie-nye Thanks a lot for that! Outstanding job!

@ollie-nye Looks great! Would mind creating a PR to DocFX's main source base? Thank you.

@cedar-ave @ollie-nye Thank you for contribution. The feature is released in v2.38.

Thank you very much @ollie-nye !

How to modify nav CSS style in 2.38 ?

It's possible to add a dropdownlist to the TOC (I want to use it for project versions) like in MSDN?

image

Thank you,

@WanderWang See this, and modify docfx.css.

@mohaOujda The theme for docs.microsoft.com is not open source. There is no easy way to achieve this for now.

DocFX Version Used: .2.42.3

Template used: (default or statictoc or contain custom template) default + custom

Steps to Reproduce:

Add dropdown items to the main nav bar

  • name: API Documentation
    dropdown: true
    href: articles/
    items:
  • name: Web Services
    dropdown: true
    href: articles/
    items:

    • name: "SOAP"

      href: api/index.md

    • name: "Core"

      href: api/api-core

image

when I click in the menu the page dosn't change i stay in http://localhost:8080/ (href dosn't work)

any idea,

Thanks,

You have a href key (articles/) under the top level drop down item, that might be causing the problem. Try removing it, see if that helps?

Thanks ollie-nye, It s work and I added a "/" at the end foreach href

Was this page helpful?
0 / 5 - 0 ratings