Report any technical problems you discover and discuss solutions.

Fragment Identifiers in Bootstrap URLs

  • Neil Pollock
  • Onderwerp Auteur
  • Offline
  • Premium lid
  • Premium lid
Meer
9 jaren 6 maanden geleden #4181 door Neil Pollock
Fragment Identifiers in Bootstrap URLs werd gestart door 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?

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
9 jaren 6 maanden geleden #4183 door tom
Beantwoord door tom in topic 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.

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • Neil Pollock
  • Onderwerp Auteur
  • Offline
  • Premium lid
  • Premium lid
Meer
9 jaren 6 maanden geleden #4184 door Neil Pollock
Beantwoord door Neil Pollock in topic Fragment Identifiers in Bootstrap URLs

Tom Reijnders schreef : 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...

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
9 jaren 6 maanden geleden #4187 door tom
Beantwoord door tom in topic 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; }

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Moderators: ronmjultenJohnSmith
Tijd voor maken pagina: 0.161 seconden
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo