Supporting each other

Community forums

Welcome, Guest
Username: Password: Remember me
Report any technical problems you discover and discuss solutions.
  • Page:
  • 1

TOPIC:

Fragment Identifiers in Bootstrap URLs 7 years 4 months ago #4181

  • Neil Pollock
  • Neil Pollock's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 92
  • Thank you received: 4
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?

Please Log in or Create an account to join the conversation.

Fragment Identifiers in Bootstrap URLs 7 years 4 months ago #4183

  • tom
  • tom's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 1294
  • Thank you received: 310
I cannot comment on the last issue, but the limit for navigating to pages 0-9 will be fixed in the next release.

Please Log in or Create an account to join the conversation.

Fragment Identifiers in Bootstrap URLs 7 years 4 months ago #4184

  • Neil Pollock
  • Neil Pollock's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 92
  • Thank you received: 4

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

Please Log in or Create an account to join the conversation.

Fragment Identifiers in Bootstrap URLs 7 years 4 months ago #4187

  • tom
  • tom's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 1294
  • Thank you received: 310
Yes, so the fix is also in that code:
startHash = window.location.hash;
	
if (startHash.substring(1,5) == "page") {
    startPage = parseInt(startHash.substring(5), 10) - 1;
}

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: ronmjultenJohnSmith
Time to create page: 0.049 seconds
Copyright © 2024 The Xerte Project.
Xerte logo Apereo logo OSI Logo

Search