-
Notifications
You must be signed in to change notification settings - Fork 4
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
Allow hidden content objects to be used in navigation #68
Comments
_isHidden is not _isHiddenOnMenus pageNav should naturally remove these content objects from normal next/back. pageNav should behave as expected if a button is manually set on |
@oliverfoster Ok, so you're saying the functionality of |
This is code in pageNav that looks at The Instead of: adapt-pageNav/js/PageNavModel.js Lines 44 to 51 in 330a72b
Do this: // Get models, skipping any undefined types (ex. deprecated button types)
// Find buttonModel from config._customRouteId if not found in defined type
let buttonModel = buttonConfig._customRouteId
? data.findById(buttonConfig._customRouteId)
: buttonTypeModels[type];
if (!buttonModel) continue; And getPrevPage and getNextPage should exclude Instead of these: adapt-pageNav/js/PageNavModel.js Lines 109 to 110 in 330a72b
adapt-pageNav/js/PageNavModel.js Lines 130 to 131 in 330a72b
Do this: const isNotShown = !page.get('_isAvailable') || page.get('_isHidden');
if (isNotShown) continue; That way, the next and prev buttons will not refer to |
🎉 This issue has been resolved in version 3.1.5 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Subject of the issue
Currently, content objects that use
"_isHidden": true
behave similarly to topics that are locked in that they are grayed out and unclickable. The difference is that you can never navigate to a hidden content object, even when using its_id
for the_customRouteId
value.In a use case that came up today, the course has a start page that's hidden from the menu. However, the client or designer (not sure which) wanted to be able to navigate to this page via the Previous button. The
_customRouteId
value for the Previous button is set to the start page's_id
, but the button always appears disabled.I understand excluding
"_isAvailable": false
content objects from Page Nav, as they aren't meant to be viewed at all._isHidden
just controls the content object's appearance on menus, though.The text was updated successfully, but these errors were encountered: