-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix: Allow overrides on content objects (fixes #12) #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm finding that the contentObject config is preventing the course config being applied globally. In a Framework build, we typically only add config when we want to override a model so this isn't an issue. In the AAT, all config exists and the default contentObject config _navigationLogo._isEnabled: false
is removing the logo from all pages unless I enable and link up an image src etc for each contentObject.
Looking at where we have similar inheritance in Adapt we could try either of the following:
- An inheritance option like we have in Trickle.
- A hide option like we have in homebutton.
Thanks, Kirsty! This will need a bit of a refactor then. The AAT always complicates things 😛 @kirsty-hames @StuartNicholls Do we need the ability to override the logo image for specific pages? Or are we fine with a single logo image that's always defined at the course level? Then, it can be shown or hidden on specific pages and the menu. |
@kirsty-hames @StuartNicholls I've added a new |
@kirsty-hames @StuartNicholls I went ahead with the |
Apologies for the delayed response but I agree with your suggestion, a single logo image with the option show/hide for specific pages and menu. |
Looking at image source defined elsewhere in Adapt, Note, boxmenu logo graphic does use |
Should this not be _small and _large so it reflects the breakpoints? |
We could do with improving/rethinking the CSS in my humble opinion (or maybe I'm missing something) but perhaps thats a separate issue anyways. |
The _ is short for not translatable. All resource URLs should start with _. src without the underscore is a mistake that was replicated. |
Just so I'm clear @oliverfoster, are we saying to use |
@kirsty-hames I think that's just an issue here, but yep, the underscore indicates 'do not translate' etc. My point is that elsewhere we use the breakpoint terminology, fixing this will be a breaking change no? Might as well update? https://github.com/adaptlearning/adapt-contrib-graphic/blob/master/example.json |
I'd agree, it does seem we use |
This is working as expected thanks @swashbuck. |
Yeas. Always use an |
Yes, which is why it hasn't yet been fixed in the graphic schema / example, please don't change the properties in adapt-contrib-graphic schema or example. It is fixed in the image.jsx template. |
@oliverfoster Completely missed there wasn't an underscore there! |
Ok, I've reverted the |
Ok to merge, @StuartNicholls ? |
@kirsty-hames correct me if I'm wrong but I think the logic is wrong here. @swashbuck I think we want the logo to appear on content object pages if there is no config present for framework builds. So example.json should also be: // contentObjects.json
"_navigationLogo": {
"_isEnabled": false
}
I think this reflects the functionality of homebutton ? Also, the default nav order is 1, which is possibly correct, but the default spacer order in framework is 0, so the logo appears on the right hand side. Wasn't it on the left perviously? Maybe spacer should be 50 in framework? |
@StuartNicholls Ok, I've made this change in d6cbc15. Content objects no longer require a |
@StuartNicholls Will you file a new ticket for this one? It may be part of a larger discussion about nav order default values. Thanks! |
Setting the nav order to 0 does mean the logo displays to the left of the spacer but agree this would be better raised as a core issue to review the nav order as a collection. On projects I typically use increments of 10 (minimum) as it gives a bit of flexibility when appending new nav items. I think this approach would be useful for setting defaults as it allows wriggle room for non-core plugins to fit around the core elements. |
Can confirm this is working as described. Testing on Mac Safari, FF, Chrome and iPhone |
README.md
Outdated
@@ -6,7 +6,7 @@ | |||
|
|||
## Settings overview | |||
|
|||
The image displays with minimal padding by default or can be configured to fill the navigation bar height. For mobile, an alternative, mobile-friendly image can be specified or the logo can be hidden entirely. | |||
The image displays with minimal padding by default or can be configured to fill the navigation bar height. For mobile, an alternative, mobile-friendly image can be specified or the logo can be hidden entirely. The logo can be shown on the menu, on specific pages, or everywhere. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add the default display to the last line?
e.g. The logo can be shown on the menu, on specific pages, or everywhere as default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in e62e714
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working as expected thanks @swashbuck. Re-tested on Mac Safari, FF, Chrome and iPhone.
🎉 This PR is included in version 3.0.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Just a note to say the |
Thanks, @guywillis . Will you mind raising a new ticket for this? Alternatively, we have a ticket ( #16 ) to align image source properties, so we could tack it on to that? |
Both the readme text and the schema title note this hides the logo on the menu. |
It's great to have the functionality defined in documentation but I do think the naming of config options should try to succinctly describe functionality too.
Sure, I'll raise a new ticket. Ticket here |
Fixes #12
Fix
_isHidden
option to hide the logo on the main menu (in course.json)_src
andalt
values from course.json