dynamic links using js in a SCORM LMS environment - Oct 1st 2010

Oct 1st 2010Hey EveryoneBelow here is an article I found regarding dynamic links in Lectora. Basically it allows all the links in a module(s?) to be located in a separate html/js file that is easily updated. Wondering if this solution would work with one js file with many different modules on a SCORM complient LMS (Clarity)? Then I could update any web address in this file and it would update all the related links in all the modules without re-exporting and reposting any of the modules. This would be SO GREAT. Even if I could get it to work per module with SCORM on an LMS it would be helpful. I am absolutely new to Lectora and js. I have worked in similar programs (Captivate) and I am sure with some determination I will be able to make sense and good use of your suggestions.Thanks in advance,StewThe Article We had a Lectora project that was going to have many (20-30) embedded links pointing to external web sites. The problem was that these URL's were going to be changing soon, with more possible changes in the future. So, we wanted to find a solution that would set all of these links to use variables as the URL's. Then, we wanted to set all of these variables externally in a file, reading them at runtime to set the most current values for the URL's, and thus pointing the links to the current site. Essentially, we wanted to externalize all of our links to one location so that we could modify them easily without painstakingly finding them one-by-one and modifying them and then having to republish the whole module. After much research and trial and error, we finally found a solution: We set up all of our variables ahead of time in Lectora. This was accomplished by clicking the menu 'Tools -> Manage Variables'. Using this manager, we added a variable for each hyperlink URL that we would need in our project. For example, we set up a variable called 'myUrl'. We next added hyperlinks that pointed to these variables that we set up. So, using the example above, we highlighted some text in a text field, right clicked and chose 'Add Hyperlink', chose 'Web Address' as the target, and typed 'Var(myUrl)' for the Web Address field. Once all of our links were pointing to the variables that we set up, we created an external .js file to hold all of our variable declarations. So, we created 'myLinks.js' with the following code: Code:VarmyUrl.set('http://www.cnn.com'); VarmyUrl2.set('http://www.google.com'); etc. Notice how the word 'Var' precedes each variable name. 'set' is a function that sets the variable specified in Lectora to the value in the parenthesis. So, the first line sets our 'myUrl' variable in Lectora to 'http://www.cnn.com' Finally, we needed to include our .js file into our Lectora project. However, we wanted to keep it external so that we could modify the link variables, and have our links in Lectora dynamically reflect these changes. This was accomplished by embedding some Javascript code into an External HTML Object to include the .js file. We clicked the menu 'Add -> Object -> External HTML' to create an HTML Object. Inside of its properties, we chose 'Header Scripting' as the Object Type, and typed the following code in the Custom HTML box:

Code:

// -->

Discussion (7)

hello,


I know this is an old post, I was wondering if someone has tried this solution?


I'm trying to do it, I'm doing all of the steps, the links work; but all of the content on my pages got align to the right of the screen


Not sure what I’m doing wrong.


Adriana

Hi Adriana,


Have you tried the Dynamic Text feature in Lectora? You can set this in v11 within the Title Options dialog accessed via the Design Ribbon (or in Title Properties in vX).


Once you enabled this feature, you can then set any text block in Lectora as "Dynamic Text" from the Text Properties. Lectora will place all the text in a "dyntitle.xml" file when you publish to HTML. Similar to the solution posted above, you can change the text in the XML and the text will update in your published content.


Thanks,

Laura

Hello,


No answers to my post :-(


Does any one have a different idea of how to accomplish dynamic links, that are not only editing on the publish title.


I need a solution for the Lectora source file and the publish version.


Thanks,


Adriana

Hello,


In case that anyone wants to use this option that is very nice to update links in the Lectora source (without opening the file) and the published version.


i found that if i do:

'Add -> Object -> External HTML' to create an HTML Object.

Inside of its properties, we chose 'other' as the Object Type, and typed the following code in the Custom HTML box:




it works perfectly, no mere problems with the alignment of objects on the screen.


Adriana

@LSS 61286 wrote:

Hi LauraM (and any other users who are familiar with this),


I'm getting this warning when publishing: “You will need to update the dyntitle.xml file in order to change the dynamic text in the published title.”


What does this mean?


Thanks!

Lisa



Hi Lisa - This is just meant to serve as a reminder that you'll need to make modifications to the xml file to see the text updated in the title - more of an informational message than a warning about how the dynamic text works.

@lauram 61287 wrote:

Hi Lisa - This is just meant to serve as a reminder that you'll need to make modifications to the xml file to see the text updated in the title - more of an informational message than a warning about how the dynamic text works.


Hi Laura,


Thanks so much for your prompt response! I noticed that the dyntitle.xml file is excluded from our output zip file. I suspect that this is because we don't seem to be using dynamic text at this time. (I don't see this option selected at the text box level.) So, I think I'll disable this feature for now.


Thanks again for your response!

Lisa

Hi LauraM (and any other users who are familiar with this),


I'm getting this warning when publishing: “You will need to update the dyntitle.xml file in order to change the dynamic text in the published title.”


What does this mean?


Thanks!

Lisa

Discussions have been disabled for this post