Skip to content

Conversation

@SAYAN02-DEV
Copy link
Contributor

Closes #11381

Fix: Exclude default carousel from subject pages when associated with a Tag

Technical

This PR modifies the subject page template to conditionally render the default QueryCarousel based on whether the subject has an associated Tag object.

Changes:

  • Modified /openlibrary/templates/subjects.html
  • Wrapped the QueryCarousel macro call in an $else block
  • The carousel now only renders when has_tag is False (i.e., when 'tag' not in page)
  • When a subject has an associated Tag, only the Tag's curated body content is displayed

Testing

  1. Subject WITHOUT Tag: Visit /subjects/love - carousel should display
  2. Subject WITH Tag: Create a Tag for any subject as admin/curator - carousel should be hidden, only Tag body content shows
  3. Verify other page sections (publishing history, related subjects, authors) still appear in both cases

Copilot AI review requested due to automatic review settings October 30, 2025 08:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the subjects page template to conditionally display a default QueryCarousel only when a subject doesn't have an associated Tag. Previously, the QueryCarousel was shown unconditionally regardless of whether the subject had a tag or not.

  • Wraps the QueryCarousel in an $else block to prevent it from showing when a tag with custom body content exists
  • Adds a clarifying comment explaining the conditional logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@jimchamp jimchamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @SAYAN02-DEV.

@jimchamp jimchamp merged commit 8946d23 into internetarchive:master Nov 4, 2025
10 checks passed
@SAYAN02-DEV SAYAN02-DEV deleted the fix-hide-carousel-on-tagged-subjects branch November 18, 2025 06:08
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.

Exclude default carousel from subject page if subject is associated with a Tag

2 participants