Skip to content

fix: CMD-162 disable 2nd-level CMS breadcrumbs#838

Merged
wesleyboar merged 1 commit intomainfrom
feat/cmd-162-disable-certain-breadcrumbs
Jul 3, 2024
Merged

fix: CMD-162 disable 2nd-level CMS breadcrumbs#838
wesleyboar merged 1 commit intomainfrom
feat/cmd-162-disable-certain-breadcrumbs

Conversation

@wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented Jul 3, 2024

Overview

Disable 2nd-level breadcrumbs (because they always redirects to 3rd-level).

Details

TL;DR: Server-side menu node properties to programmatically disable links (remove href) are blank, so we use JavaScript to force-disable 2nd-level breadcrumbs. The styles merely tweak disabled breadcrumb appearance.


In Django CMS, a page added such that it appears in the navigation. On that page, the page will appear in the breadcrumbs as text, not a link, because it is the current page. Server-side code performs that. A parent page can be added such that it appears in the navigation as a dropdown link. The link only opens the menu of child pages; it does not navigate user to a page. Server-side code performs that. If one visits a child page, the parent page will appear in the breadcrumbs as a link. Clicking that link will take user to the parent page. Server-side code performs that. Because the page is not intended to be navigated to — and only was able to be navigated to via link after breadcrumbs were added — CMS admin has always left such pages blank or (more commonly) made them redirect to the most relevant child page. Server-side code allows that. To avoid user clicking such a parent page in the breadcrumbs, we would set the href to blank, but attempts to do this server-side fail because useful menu props are blank. So we use JavaScript to force-remove the href value. We add styles to tweak the appearance of a disabled breadcrumb link.

Related

Changes

To breadcrumbs template:

  • added style tag
  • added script tag

Testing

  1. Open https://localhost:8000/.
  2. Create/Visit a child page of a child page or a top-level page.
    E.g. Home > Fruit > Tropical > Bananas.
  3. Verify
    • has "> Fruit >"
    • "Fruit" is not clickable
    • "Fruit" does not have link color
    • "Fruit" is opaque
    • "Fruit" is different color than current page in breadcrumbs

UI

before after
before after
before.mov
after.mov

@wesleyboar wesleyboar marked this pull request as ready for review July 3, 2024 16:43
@wesleyboar wesleyboar merged commit 9755984 into main Jul 3, 2024
@wesleyboar wesleyboar deleted the feat/cmd-162-disable-certain-breadcrumbs branch July 3, 2024 16:43
wesleyboar added a commit to TACC/tup-ui that referenced this pull request Jun 5, 2025
This has been successful from Core-CMS since Core-CMS v4.12.0.

TACC/Core-CMS#838
wesleyboar added a commit to TACC/tup-ui that referenced this pull request Jun 5, 2025
These have been successful from Core-CMS since Core-CMS v4.12 and v4.13.

TACC/Core-CMS#838
TACC/Core-CMS#855
jarosenb pushed a commit to TACC/tup-ui that referenced this pull request Aug 25, 2025
* fix: embeds too short for podcasts from new source

We migrated to RSS.com for podcasts. The embeds are too short.

* chore: css-c-feed-list-tweaks

* chore: css-fix-news-hr-behind-offset-image

* docs: testing (temp)

* fix: embeds too short for podcasts, narrow screen

* chore: css-spacing-fixes

* chore: css-hide-svg-icons

* chore: css-tup-730-drop-cap-and-fix-has-blog-tag-no-drop-cap

* docs: css-tup-730-drop-cap-and-fix-has-blog-tag-no-drop-cap

* chore: css-tagged-news-uppercase-tag

* refactor: css snippets to stylesheets

* fix: css snippets to stylesheets

* refactor: load global css that was in snippets

* fix: js snippets to scripts

* fix: js snippets to scripts

* refactor: load global js that was in snippets

* chore: npx nx format:write

* refactor: isolate imports of unorganized css

* docs: how to test global js

* fix: missed one global CSS snippet

* refactor: rename unorganized stylsheets

* fix: typo in podcast-embeds.css

* chore: delete breadcrumbs.js

This has been successful from Core-CMS since Core-CMS v4.13.1.

TACC/Core-CMS#855

* refactor: one ad-hoc javascript to load them all

* chore: remove hard-coded load of ad-hoc javascript

* refactor: one ad-hoc stylesheet to load them all

* chore: delete s-breadcrumbs.css

This has been successful from Core-CMS since Core-CMS v4.12.0.

TACC/Core-CMS#838

* Revert "chore: delete s-breadcrumbs.css"

This reverts commit 316e766.

See #515 instead.

* Revert "chore: delete breadcrumbs.js"

This reverts commit fee6d53.

See #515 instead.

* docs: what page a bug occurs on

* docs: pr test

* docs: doubly comment out drop-caps code

No need for entirely commented out code to show on live site.

* docs: pr testing

* chore: delete temp pr testing doc

* refactor: move ad-hoc js out of modules

* fix: bad js path

* fix: undo bootstrap via rever not unset

and wrap in correct layer, so we don't undo our own (were we to have it)

* fix: continue to hide SVG from everyone

* feat: save 2 snippets to load global CSS & JS

* feat(cms): ad-hoc snippet .u-image

* fix(cms): .u-image should work on child image

* docs: change css comment to match page text change

* chore: do not load stylesheet that is all comments

* chore: save a-legend-key-to-the-icons

* chore: delete unused tup_cms/css/ad-hoc.css

Instead of loading this, I use [Snippet #167](https://tacc.utexas.edu/admin/djangocms_snippet/snippet/167/change/) to load styles via many `<link>`s.
wesleyboar added a commit to TACC/tup-ui that referenced this pull request Feb 5, 2026
This has been working via Core-CMS for almost a year.

TACC/Core-CMS#838
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant