CLM code in go to url

Hi there
I want to know if i could use link like this on "go to URL" in Hype
CLMPlayer.gotoSlide(seqId, '03_index.html') as i exported every slide as a separated files named every one by its number _index.html
in html in menu i used
< div class="menu1-item1 menu-item" onclick="CLMPlayer.gotoSlide(seqId, '03_index.html', 'undefined')" data-prevent-tap="true" >
< div class="menu1-item2 menu-item" onclick="CLMPlayer.gotoSlide(seqId, '04_slide.html', 'undefined')" data-prevent-tap="true">...etc

Not at my mac at mo.
But it is unlikely that will work.

Can you provide more details of your setup, including where and when is the CLMPlayer function declared
Can you provide an example project?

The probable route to go is give each button an attribute with the value for the go to and have it run a hype function that retrieves the value and uses it to call the CLMPlayer function.

there is a file that worked fine over the clm platform (OCE ) but i didn't work it over hype, the point that i like to give the links on hype project
sample.zip (1.5 MB)

Note that the links will not work here, but you can check the code inside the HTML files

Yer, not sure that's really helpful.

Any way, if the CMLPlayer function is declared elsewhere outside of hype and before hype loads.

The Menu buttons can have an attribute that has the html file name.

Screenshot 2023-05-18 at 17.58.26

Then you simply need your buttons to call a hype function that runs the CLMPlayer.gotoSlide.. code

Screenshot 2023-05-18 at 17.58.43

var thisMenuValue = element.getAttribute("slide")


	CLMPlayer.gotoSlide(seqId, thisMenuValue)
1 Like

first thanks for your reply but iDo i have to replace this MenuValue with any name or it will take the link from the button attribute

If you mean this then yes, that line will fetch the value you give the button in the attributes.
Each button gets its own attribute value.

But note. what I suggest is only a guess of what may work with your setup.

1 Like

thanks, but it doesn't work, is there a way to give the page id by any functions, it jumps correctly when i write the path of the slide in Go to URL, but the problem that the system need to get the ID of every page

Can you post you actual Hype Project or a small Example project show what you are doing and how you have set this up.

Also show what and where the CLMPlayer code is ?

this is what they wrote in their guideline

https://we.tl/t-S1dmCW3Dte

JS code can be executed from the template while being rendered in the WebKit view window.
The specific gotoJS function is detected by the iOS code and the result is an action performed by the
native part of the player.

CLMPlayer.gotoSlide(sequenceId/sequenceName, slideName, animation)

Goes to the sequences and assets in the presentation.

This method accepts the following arguments:
a. either sequenceId or sequencename: l sequenceId: id of a sequence.
If sequenceId == null, the current sequence is used.

You can use sequence ids to go to presentation sequences only.
l sequenceName: name of a sequence or asset.
You can use sequence or asset names to go to the presentation sequences and assets.

Note: Use unique names for sequences and assets within a presentation to ensure the
correct sequence or asset is opened by the CLMPlayer.gotoSlide() function.
b. slideName: name of slide

the project you supplied is just a bunch of scenes?
No code or setup. and the snippet mentions iOS !.

I found this which seems similar to what you want to do and also seems it needs to be called similar to how I suggested you try,

https://developer.veevacrm.com/doc/Content/clm-v1.htm#gotoSlideV2keypresentation

Their example

function navigateToHomePage() {
    com.veeva.clm.gotoSlide("Home_Page","");
    //Navigates to the slide in the current presentation with the Media_File_Name_vod__c field of "home_page"
}

Using their way

var thisMenuValue = element.getAttribute("slide")
	//CLMPlayer.gotoSlide(seqId, thisMenuValue)
	
	com.veeva.clm.gotoSlide(thisMenuValue,"")

If I down load that library and set it up I get an error response from it in regard to postMessage, which tells me it is working but I do not have the full setup in place.

I/we can only go so far in trying to help you with the limited info you keep giving. For example I have had to go looking on the internet to try and find what Library or product you are using, to try and get a fuller understanding.

For me there are still too many holes in what your setup is, what library you are using, or even who are 'THEY"
So unfortunately I think this is as far as I can go with this.

I worked over veeva by add link in gotourl
Veeva:gotoslide(sample.html)
And it worked
Could I do something like this here
Sorry for confusion..here it is the full guide