Report any technical problems you discover and discuss solutions.

Xerte page links in Bootstrap

Plus d'informations
il y a 7 ans 7 mois #5580 par ronm
Réponse de ronm sur le sujet Xerte page links in Bootstrap
Ok for the moment please try the following:

1. Select the first icon in your bootstrap project and add an optional script property
2. Add the following code to that script box either below or replacing the default //javaScript / jQuery
Code:
function x_navigateToPage(force, pageInfo) { // pageInfo = {type, ID} var pages = $(data).find('page'); var links = ['[first]', '[last]', '[previous]', '[next]']; var linkLocations = [0, pages.length-1, Math.max(0,currentPage-1), Math.min(currentPage+1,pages.length-1)]; // First look for the fixed links if ($.inArray(pageInfo.ID, links) > -1) { parseContent(linkLocations[$.inArray(pageInfo.ID, links)]); goToSection('topnav'); $('html, body').animate({ scrollTop: 0 }, 'fast'); } else { // Then look them up by ID for (var i=0; i<pages.length; i++) { if (pages[i].getAttribute("linkID") == pageInfo.ID) { parseContent(i); goToSection('topnav'); $('html, body').animate({ scrollTop: 0 }, 'fast'); break; } if (pages[i].childNodes.length > 0) { for (var j=0; j<pages[i].childNodes.length; j++) { if (pages[i].childNodes[j].getAttribute && pages[i].childNodes[j].getAttribute("linkID") == pageInfo.ID) { parseContent(i); goToSection('page' + (i+1) + 'section' + (j+1)); break; } } } } } }

You can see this working via xot.xerte.org.uk/play.php?template_id=138
Please report back whether this does what you want?
This should work as a temporary solution for you for now but I don't want to commit this as a change to core Xerte code yet because longer term we need to add a choice so that if someone want to add a page link to a specific page but also a specific section or tab in a page that they can choose to do so e.g. it might not always be the case that you want to jump to the top of the destination page.

HTH
Ron

Xerte developer & trainer
e-learning & m-learning consultant
mitchellmedia.co.uk | xerteacademy.com | learningapps.co.uk
Note: Support here is voluntary and meant for users to support each other.
Need direct commercial support with Xerte? mitchellmedia.co.uk/contact/

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

Plus d'informations
il y a 7 ans 7 mois #5581 par jsi22
Réponse de jsi22 sur le sujet Xerte page links in Bootstrap
Thanks Ron, this works for us. It will be good if this can be integrated into a future version of Xerte so we don't have to add it to each bootstrap project.

Regards,
John

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

Plus d'informations
il y a 7 ans 7 mois #5582 par ronm
Réponse de ronm sur le sujet Xerte page links in Bootstrap
Thanks for confirming it works for you John.
Yes we'll add this or something similar sooner rather than later and then (once your install is upgraded) you will be able to remove the custom script from any projects to which you have added it. But also we have many more enhancements and additions planned and will be working on some of those next week where some of us will be working together following the Future Teacher Conference and there may well be a new release by the end of January.

HTH
Ron

Xerte developer & trainer
e-learning & m-learning consultant
mitchellmedia.co.uk | xerteacademy.com | learningapps.co.uk
Note: Support here is voluntary and meant for users to support each other.
Need direct commercial support with Xerte? mitchellmedia.co.uk/contact/

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 7 ans 4 mois #5682 par Neil Pollock
Réponse de Neil Pollock sur le sujet Xerte page links in Bootstrap
Just to say, this doesn't work if you have a fixed top nav bar and click the page links from there.

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

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