Using an iframe to extend the frontend UI

This sample gives some clues about how to use an iframe in the frontend UI. This sample uses the ExtraTab feature with an iframe that contains references to OpenKM objects as links.

The HTML file contains valid OpenKM UUID links.

The sample below uses Exposed frontend JavaScript API.

File extra_tab.html:

<html>
<head>
  <title>Example</title>
</head>
<script type="text/javascript">
  function openPath(path) { 
    parent.jsOpenPathByUuid(path);
  }
</script>
<body>
<h1>url</h1>
  <a href="javascript:void();" onclick="openPath('9789ac11-ac03-4ce7-87e9-9643b0ddf99a');">Document link example 1</a>
</body>
</html>

Copy the extra_tab.html file into  the $TOMCAT/webapps/OpenKM folder.

Copying to the OpenKM folder is mandatory; otherwise the iframe will not be able to access protected resources.

When the contents of OpenKM.war are changed, a new version of the application is deployed, all the contents in $TOMCAT_HOME/webapps/OpenKM will be refreshed, and you will lose any changes you made directly in the webapps/OpenKM folder.

Finally, configure the ExtraTab feature with the new URL, for example  http://localhost:8080/OpenKM/extra_tab.html.

Consider http://localhost:8080/OpenKM/extra_tab.html as an example. You should use your own public OpenKM application URL.

Table of contents [ Hide Show ]