Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

site nav: difficulty in creating a drop-down item #272

Closed
damithc opened this issue Jun 22, 2018 · 3 comments · Fixed by #297
Closed

site nav: difficulty in creating a drop-down item #272

damithc opened this issue Jun 22, 2018 · 3 comments · Fixed by #297
Assignees

Comments

@damithc
Copy link
Contributor

damithc commented Jun 22, 2018

I can't seem to be able to create a drop-down item in this site navigation menu https://nus-cs2103.github.io/website-base/se-book-adapted/index.html

https://nus-cs2103.github.io/website-base/se-book-adapted/index.html

Code (uses some nunjucks):

<markdown>
{% import "se-book-adapted/config.md" as config with context %}

* [Home {{ glyphicon_home }}, printable versions {{ glyphicon_print }}]({{baseUrl}}/se-book-adapted/index.html)
{% for section in config.topics %}
* **{{ section.heading }}**  <!-- this line should be a drop-down ??? -->
  {% for chapter in section.chapters %}
    * [{{ chapter.heading }}]({{baseUrl}}/se-book-adapted/chapters/{{ chapter.name }}.html)
  {% endfor %}
{% endfor %}

<markdown>
@Chng-Zhi-Xuan
Copy link
Contributor

Chng-Zhi-Xuan commented Jun 22, 2018

I have narrowed the problem to a specific piece of code if ($(this).children().first().is('ul')){....}.

If you insert any styling for the dropdown title (tested <strong> for bold (**) and <mark> for highlights (==)) It will treat it like a <a href="..."> tag and not render the dropdown list. <span> (when using Glyphicons) seems fine so far.

A temporarily work around is not to style your dropdown titles. Using {{glyphicons}} and Emojis seems fine though.

Will fix this soon 👍

@damithc
Copy link
Contributor Author

damithc commented Jun 22, 2018

Thanks. No hurry.
It seems extra blank lines in the code and interfere with identifying which items should be dropdowns.

Noticed another oddity in this page https://nus-cs2103.github.io/website-base/admin/index.html#admin-appendixC-faq
image
Appendix C is nested at the wrong level. Code https://raw.githubusercontent.com/nus-cs2103/website-base/master/_markbind/navigation/adminSiteNav.md

@Chng-Zhi-Xuan
Copy link
Contributor

Seems like an issue regarding the text being centered after wrapping around for exceeding the length.

A change to the .CSS will fix this 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants