-
Notifications
You must be signed in to change notification settings - Fork 152
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
[7571] On the BanneredCampaignPage, only show root page title if the … #7637
Conversation
…menu is shown too
This PR introduces visual differences. Click here to inspect the diffs. |
1 similar comment
This PR introduces visual differences. Click here to inspect the diffs. |
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.
Design-wise, this is working well!
Good find! |
Hm, one thing that percy flags: https://foundation-s-fix-7571-g-pex1xa.mofostaging.net/en/campaigns/initial-test-bannered-campaign-with-fixed-title/ no longer uses its title, but now uses its header instead. (edit page: https://foundation-s-fix-7571-g-pex1xa.herokuapp.com/cms/pages/76/edit/) @kristina for a banner page with both title and header, what should happen in this case? |
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.
noticed something different happening on https://foundation-s-fix-7571-g-pex1xa.mofostaging.net/en/campaigns/initial-test-bannered-campaign-with-fixed-title/ now
Yikes, thanks for flagging that @Pomax! It should show the Title at the top of the page. TBH I don't really understand the differences in the Title and the Header. |
This PR introduces visual differences. Click here to inspect the diffs. |
❤️ the visual regression tests. There are some subtleties in the template logic but basically the header will override the title if its set. This is complicated by an extra variable ( Before my change, the I'm painted into a bit of a corner with regard to template logic unless I remove outputting the header, which doesn't seem to be shown anyway because of
|
Did this break multi-pages under /giving? I added a sub page to https://foundation-s-fix-7571-g-pex1xa.mofostaging.net/en/giving/happy-holidays-from-mozilla/ and it isn't showing up. |
@kristina I just did a test against |
@richbrennan @kristinashu I'm okay with removing the header field if we're not using it, but then let's make sure we also test this against our current real data in the staging db. @richbrennan you should be able to run |
Thank you for the list Rich. So this update won't change anything on /campaigns pages? The original issue isn't happening on those pages so they don't need any update. I'm just checking because they are our most used pages. |
Sorry, it's a can of worms! Re:
I just tested on staging and confirm the sub-page of "holiday" aren't showing up. That seems like a separate bug because it should show up (like it does on all other pages https://foundation.mofostaging.net/en/campaigns/meet-mozillas-advocacy-and-research-team/). This is where the "Header" text is used, although perhaps renaming it to "Name in sub-nav" or "Sub-nav name" would be more helpful. Would removing the Header field only happen if there are no sub-child pages? tl;dr is that pages under /giving should behave the same as pages under /campaign pages Also note that PNI is more important than this PR so if it is more complex than it appears it's ok to pause on it. Also, I hope I'm not derailing this too much. I don't fully understand all the implications. |
The difference is that "giving" is already a real, active banner page, which is the bannered version of a campaign page, whereas the Basically, in terms of "how does the page present to the user as content-with-menu", these two URLs take you to the same "type" of page:
On both URLs, only direct children of "that page" show up in the menu, so:
|
Having said that, https://foundation.mofostaging.net/en/giving no longer seems to show any content, despite the CMS clearly showing that there is (see https://foundation.mofostaging.net/cms/pages/1126 and https://foundation.mofostaging.net/cms/pages/1126/edit), so that's definitely a problem. @richbrennan it might make sense to put this PR on pause for a bit to see if we first write out the exact behaviour we want to have happening here (with @kristinashu's input/sign-off) before we then update the code to implement that behaviour. |
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.
Let's pause this for a bit so we can formulate a plan of attack.
Page/template investigation This investigation covers what is displayed in the H1 element on applicable pages as per the original issue. I haven't looked at the menus that use the header field as that's a different component, do we need to investigate these too, if so would a separate issue be less likely to cause confusion? The title/heading logic that displays the H1 is contained in the
The H1 is populated by these variables in the following priority order:
root is a custom variable (an instance of a page) who's value is set depending on the page's parent type, see individual descriptions below. Individual page logic Homepage Banner Page Primary Page MozFest Homepage MozFest Primary Page Questions/issues
The first link is a Banner page with a Campaign Index page ancestor (parent), so root will be the page itself and its own title will show in H1. With regard to the last three comments related to staging, none of my changes are on staging and these seem to related to the menu rather than the H1, so maybe we discuss and spin off into a separate issue? Note Phew. @Pomax @kristinashu |
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.
Approving this to check Percy integration
…menu is shown too
Closes #7571
This PR contains a change to the Banner Page template to only show the parent page title if the menu is shown:
The menu is shown when one or more child pages of the parent have 'Promote' > 'Show in menus' ticked.