Skip to content

Add "Go to Hadith Number" navigation input field#154

Closed
anaskex wants to merge 1 commit into
sunnah-com:masterfrom
anaskex:add-search-hadith-number
Closed

Add "Go to Hadith Number" navigation input field#154
anaskex wants to merge 1 commit into
sunnah-com:masterfrom
anaskex:add-search-hadith-number

Conversation

@anaskex

@anaskex anaskex commented Jan 28, 2026

Copy link
Copy Markdown

This PR adds a new input field in the index view to allow users to jump directly to a specific Hadith number within a collection.

Closes #153

Changes:

  • Added field and button in the index search container
  • Added JavaScript function to navigate to /collectionName:hadithNumber
  • Accepts only numeric input, preventing invalid navigation
  • Cross-browser compatible; CSS ensures numeric input looks clean without spinners consistent with design

Benefits:

  • Improves usability for users browsing collections
  • Safe client-side only navigation, no database or server risk
  • Works on all modern browsers and mobile devices

@hasankhan

Copy link
Copy Markdown
Collaborator

Closing as a duplicate of #164, which implements the same Go to Hadith Number feature with a more complete approach: it extracts a reusable collection/_go_to_hadith.php widget, includes it on both the collection landing page and book/single-hadith pages, uses uniqid() to avoid ID collisions when the widget appears multiple times on a page, json_encodes collectionName to prevent XSS, and reuses the existing search-box CSS variables for light/dark theme support. Thanks for the contribution — please feel free to review or build on top of #164.

@hasankhan hasankhan closed this May 31, 2026
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.

Add "Go to Hadith Number" input field to navigate collections

2 participants