Report any technical problems you discover and discuss solutions.

Fragment Identifiers in Bootstrap URLs

  • Neil Pollock
  • Auteur du sujet
  • Hors Ligne
  • Membre premium
  • Membre premium
Plus d'informations
il y a 9 ans 7 mois #4181 par Neil Pollock
Fragment Identifiers in Bootstrap URLs a été créé par Neil Pollock
I want a Bootstrap page to behave a bit more like an actual website, whereby a user is able to use the Forward and Back browser buttons to go to previously viewed pages within the Bootstrap page. At the moment clicking the Back button will take a user to whatever site they were viewing before arriving at the Bootstrap page.

Is this possible?

I wondered whether this could be achieved with fragment identifiers. At the moment, I can access a specific section of a Bootstrap page using, for example: xerte.example.ac.uk/play_1234#page8

However, this method only seems to work for page numbers 1-9. Anything greater than 9 doesn't appear to work (e.g. #page10 actually navigates to page 2).

Also, once you have loaded a page with a fragment identifier, you can't then navigate to another page using a different identifier. For example, if you load xerte.example.ac.uk/play_1234#page8 then change the URL to xerte.example.ac.uk/play_1234#page9 it will remain on page 8.

Am I missing something here?

Is there an easier way to give every page/section a unique URL?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 9 ans 7 mois #4183 par tom
Réponse de tom sur le sujet Fragment Identifiers in Bootstrap URLs
I cannot comment on the last issue, but the limit for navigating to pages 0-9 will be fixed in the next release.

Connexion ou Créer un compte pour participer à la conversation.

  • Neil Pollock
  • Auteur du sujet
  • Hors Ligne
  • Membre premium
  • Membre premium
Plus d'informations
il y a 9 ans 7 mois #4184 par Neil Pollock
Réponse de Neil Pollock sur le sujet Fragment Identifiers in Bootstrap URLs

Tom Reijnders écrit: but the limit for navigating to pages 0-9 will be fixed in the next release.

#

Thanks. I was actually just digging in the JavaScript and I found the issue:
Code:
startHash = window.location.hash; if (startHash.substring(1,5) == "page") { startPage = parseInt(startHash.substring(5, 6), 10) - 1; }

Seems it's only allowing single digit numbers for page numbers...

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 9 ans 7 mois #4187 par tom
Réponse de tom sur le sujet Fragment Identifiers in Bootstrap URLs
Yes, so the fix is also in that code:
Code:
startHash = window.location.hash; if (startHash.substring(1,5) == "page") { startPage = parseInt(startHash.substring(5), 10) - 1; }

Connexion ou Créer un compte pour participer à la conversation.

Modérateurs: ronmjultenJohnSmith
Temps de génération de la page : 0.142 secondes
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo