Open pdpinch opened 3 years ago
@pdpinch What is the expected behavior here? I'm not familiar with what list_in_left_nav
does
Sorry George, the history of issues and PRs on this are not clear. I updated the description and I hope it makes sense now.
@pdpinch FYI the reason for the link in your example showing up when list_in_left_nav
is set to false is because of this:
if (inRootNav || listInLeftNav) {
courseSectionFrontMatter["menu"] = {
leftnav: {
identifier: pageId,
name: shortTitle || "",
weight: menuIndex
}
}
if (parentId) {
courseSectionFrontMatter["menu"]["leftnav"]["parent"] = parentId
}
}
Since Syllabus is in the root of the nav, it's shown regardless. It looks like I had come to that conclusion here: https://github.com/mitodl/hugo-course-publisher/issues/181. It seems at that point, list_in_left_nav
was not being set at all for root level items so it was assumed that they were to be shown regardless.
Yes, as Carey said list_in_left_nav
has the correct values for 11-405-just-money-banking-as-if-society-mattered-spring-2021
but it doesn't have the correct values for 20-020-introduction-to-biological-engineering-design-spring-2009
which is the course linked in https://github.com/mitodl/hugo-course-publisher/issues/181, so I don't think we can use it for the sidebar
@pdpinch For example, the Syllabus page for 20-020 is listed in the sidebar:
But it is false
in the parsed JSON:
Here's another example where
"list_in_left_nav": false,
but the item still appears in the left nav.
OCW Next: https://ocwnext.odl.mit.edu/courses/6-036-introduction-to-machine-learning-fall-2020/ Legacy: https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-036-introduction-to-machine-learning-fall-2020/
After investigating this further, it looks like we maybe should be using a different key from the raw Plone JSON, excludeFromNav
, instead of list_in_left_nav
As a course author, I want to hide some pages from the left navigation, but still have them available in the course.
For example, compare the left nav on legacy OCW 11.405 SP21
with OCW Next 11.405 SP21
This choice is indicated in the parsed JSON by the
list_in_left_nav
key. When it is present and set to false, the item should appear in the left nav.For example the JSON at s3://open-learning-course-data-production/11-405-just-money-banking-as-if-society-mattered-spring-2021 contains:
related issue: