Forum Discussion
Jump to location in published file using url string parameters?
Thank you for your input Gary. This looks like it might come in handy as we develop. I already have a library of a thousand or so published projects and was hoping to find a way to do this with already published content. I understand it might be possible but I thought I would shoot for the moon.
I was looking through the frame.xml file and there are preassigned slide numbers in each frame.xml... I wonder if we added the javascript to the first slide of each project if we could use the preassigned slideid variables as our anchors. I know other preassigned variables (such as quiz.scorepercent) cannot be pushed or pulled from a project without a javascript assignment. And those variables are visible in the project while the slideid isn't even a variable but more of an attribute.
Simply execute the following JavaScript code when the timeline starts on the Slide Master:
window.JumpToSlide = function (key) {
var targetSlide = DS.presentation.getFlatSlides().find(function (slide) {
return slide.id === key || slide.get("title") === key;
});
if (targetSlide) {
return DS.windowManager.requestSlideForReview(targetSlide, "_frame").then(function () {
return { target: targetSlide.absoluteId };
});
} else {
return Promise.reject("Slide with id or title '" + key + "' not found");
}
};
You can then call this function from any slide, passing either the slide title or slide ID as an argument.
For example: JumpToSlide('How to navigate this course') or JumpToSlide('6Ps9FWa1eB0'). In practice, I find it easier to copy and use the slide title rather than searching for the exact slide ID.
Related Content
- 12 months ago
- 3 years ago