Learn icon indicating copy to clipboard operation
Learn copied to clipboard

Align local nav and add breadcrumbs for pages

Open outdoor2kode opened this issue 1 year ago • 1 comments

Closes #2511

This PR ensures that the page has the correct breadcrumbs. Additionally, it makes the local navigation behave according to the design shown in the image below.

image

I'm not so sure where the learning pathway term falls, because the term page is already at Level 3 depth, and due to the design, there are no breadcrumbs, so should we follow the behavior of L3 by displaying the term name in the local navigation when scrolling? cc @fcoveram

Default Scroll
Screenshot 2024-07-04 at 03 53 35 Screenshot 2024-07-04 at 03 53 44

Also, for the L2B part, it will need to have a breadcrumb level value to help with the determination. So I'm going to wait to see if the current method of retrieving that value makes sense.

Screenshots

Default Scroll
L3 Screenshot 2024-07-03 at 22 42 42 Screenshot 2024-07-03 at 22 42 55
Screenshot 2024-07-04 at 03 14 19 Screenshot 2024-07-04 at 03 14 28
Screenshot 2024-07-04 at 03 14 37 Screenshot 2024-07-04 at 03 14 43
L2A Screenshot 2024-07-04 at 03 26 06 Same
Screenshot 2024-07-04 at 03 26 13 Same
Screenshot 2024-07-04 at 03 26 20 Same. Note that the link isn't highlighted
Screenshot 2024-07-04 at 03 25 49 Same. Note that the link isn't highlighted
Screenshot 2024-07-04 at 03 25 58 Same
L1B This site doesn't have L1B -
L1A image image

outdoor2kode avatar Jul 03 '24 19:07 outdoor2kode

Found another edge case @renintw, freestanding Lessons don't have a Course parent for the breadcrumb. Breadcrumb should probably be Home / Lessons / Lesson Title

Screenshot 2024-07-05 at 12 01 14 PM

adamwoodnz avatar Jul 05 '24 00:07 adamwoodnz

Found another edge case @renintw, freestanding Lessons don't have a Course parent for the breadcrumb. Breadcrumb should probably be Home / Lessons / Lesson Title

Weird, I don't see this issue either in this PR or in #2594 image

outdoor2kode avatar Jul 07 '24 16:07 outdoor2kode

Found another edge case @renintw, freestanding Lessons don't have a Course parent for the breadcrumb. Breadcrumb should probably be Home / Lessons / Lesson Title

Weird, I don't see this issue either in this PR or in #2594

Try this one https://learn.wordpress.org/lesson/publishing-with-the-block-editor/

adamwoodnz avatar Jul 08 '24 03:07 adamwoodnz

Found another edge case @renintw, freestanding Lessons don't have a Course parent for the breadcrumb. Breadcrumb should probably be Home / Lessons / Lesson Title

Weird, I don't see this issue either in this PR or in #2594

Try this one https://learn.wordpress.org/lesson/publishing-with-the-block-editor/

I think that's the data issue, as other freestanding lessons look fine, though I didn't check all the lessons, there might be some out there. This can be fixed by saving the post again, it's likely that the lesson originally belonged to a course, and that course was deleted but the related data for the lesson is still there.

Open a ticket for it: https://github.com/WordPress/Learn/issues/2644#issue-2394564182

Note: this is the logic where processing the freestanding lessons, for the example raised here, it has a value for lesson_course_id, but the course doesn't exist. That's why I think it originally belonged to a course.

outdoor2kode avatar Jul 08 '24 04:07 outdoor2kode