Skip to content

[MAIN] STERICMS-896 Enhance facet list functionality with no-results message…#1059

Draft
Mao8a wants to merge 2 commits into
mainfrom
feature/STERICMS-896-topic-filter
Draft

[MAIN] STERICMS-896 Enhance facet list functionality with no-results message…#1059
Mao8a wants to merge 2 commits into
mainfrom
feature/STERICMS-896-topic-filter

Conversation

@Mao8a

@Mao8a Mao8a commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

… and topic filtering

Summary

STERICMS-896 — Resource Center topic pages show the entire library instead of filtering by topic
https://herodigital.atlassian.net/browse/STERICMS-896

Root cause

blocks/facet-list/facet-list.js never constrained results by the current page's topic — only by the configured sheet and manually-checked facets, so topic pages behaved identically to the main resource-center listing.

Fix

Added getPageTopic()/normalizeTopicValue() to blocks/facet-list/facet-list.js, wired as a base filter in getResults(), updateResults(), and getFacets(). Topic identity defaults to the URL slug and is also authorable via a topic block-config row. Added an empty-state message for topics with no matches.

function getPageTopic() {
  if (PAGE_TOPIC_OVERRIDE) {
    return PAGE_TOPIC_OVERRIDE;
  }
  if (PAGE_LOCALE === 'fr-ca') {
    return null;
  }
  const { pathname } = window.location;
  const match = pathname.match(/\/topics\/([^/]+)/);
  return match ? match[1] : null;
}

Test URLs

Before

After

Reference (unaffected page)

@aem-code-sync

aem-code-sync Bot commented Jul 17, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

@aem-code-sync

aem-code-sync Bot commented Jul 17, 2026

Copy link
Copy Markdown

…t function for improved topic-based filtering
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