aemsites / piramal

Apache License 2.0
0 stars 0 forks source link

[Loans pages] Breadcrumbs #19

Open asthabh23 opened 1 month ago

asthabh23 commented 1 month ago
Screenshot 2024-07-18 at 12 33 02

Breadcrumbs are visible only on desktop view

buuhuu commented 1 month ago

We can do that in 2 ways:

1) manual: allow authors to create a breadcrumb per page, usually a linked list 2) automatically

For automatically we need to find the ancestors of the current page somewhere, and again have options.

One easy approach is to look at the main navigation and find the ancestor path in there. That means the breadcrumb labels are fixed to the texts used in the navigation. It has been said, that the breadcrumb texts for some pages differ.

Given that need to get the ancestors form a different place, usually an index of all pages with the path and the text to show. That text can be either the page title or some metadata managed on the pages.

To add the metadata we can define a page-metadata model, and add a navTitle or breadcrumbTitle text field to it. It will be shown in Universal Editor. The index needs to be defined and should include at least that breadcrumbTitle the page title and the path.

When adding breadcrumbs automatically we have to make sure to append them after the LCP content, so not in the first section of the page. Usually the breadcrumb block decoration is able to find the right place to insert itself (e.g. before a hero block), but the block itself can as well be added at the end of the last section of the page.