HTML Forms and Javascript In RoboHelp 2020

Community Beginner ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

Is there any way to insert Javascript and HTML forms into my Robohelp project?   My requirement is to create a login form which then accessess an authentication server.

Views

121

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

You can certainly add js files and I believe HTML forms are just HTML so you could add those as well and even edit them in RH (new RH is better at not messing with your code, but I couldn't say it'd remain 100% untouched as I haven't tested it).

 

I'm not a developer, but if your intention is to prevent people accessing the help without logging in, I'd have thought the login form would need to be external to the help. My reasoning is that the help is all tied together with the TOC, index and search, and once you're in you have access to all those features already.

 

My thought is that the web server would need to check every request for an authentication token and if it doesn't find it, redirect every help call to the login page.

 

I could be wrong with my theory though. 🙂 I'd recommend talking to your developers.

 

HTH

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

My thought is that the web server would need to check every request for an authentication token and if it doesn't find it, redirect every help call to the login page.

 

That's pretty much it.  What I need is to create a login form (username/password) for the user to log in to.  When they click the submit button, I do an ajax request to the endpoint on the server.  Then the next page will set the cookie which has the signed bearer token in it, and that will be checked on subsequent requests.     I am the developer so I can make it anything I want.

 

However I see no documentation anywhere for Robohelp 2019/2020 for creating forms or inserting Javascript.  I can create js files, but the HTML presets ignore them if they aren't referenced so they don't get copied to the output.  And I have to provide a link tag to reference them.   Where do I do that?

 

In web searches I see that earlier versions (Classic?) Robohelp had tools for this.   That seems to have been taken out starting in 2018.   Is that correct?

 

For 2019/2020 No documentation or example at all.  A link would be appreciated.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

Ah I think I see.

 

Am I right that the js will need to be in every topic page in the help? If so, the easiest way to do it is to use a master page and include the javascript script tag in the master page header section (don't confuse this with the HTML head tag). Then in the output preset, select the master page. If there's already a master page in use, add the js to that one. 

 

The RH Classic "baggage files" feature is now handled through the table of contents. If you need to include the form in the help itself, you can add the form HTML page to the table of contents so that it's included in the output. I assume you don't want it to appear in the table of contents, so tick the checkbox "Hide in output" in the table of content Properties panel.

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 14, 2020 Oct 14, 2020

Copy link to clipboard

Copied

LATEST

Yes, you can simply link your js file in the <head> with the script element like this:

 

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
  <head>
    <title>Link a JavaScript file</title>
    <script src="../assets/js/sso/myloginwall.js" type="text/javascript"></script>
  </head>
  <body>
    <!-- body page content goes here -->
  </body>
</html>

 

If your company is using e.g., okta, you can find the documentation on which code to implement and where, here

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation