Mashups in virtual proxy with prefix
If your Qlik Sense environment is using a virtual proxy with prefix you must manually add this prefix to the mashup code in both the main JavaScript file and in the main HTML file.
Example: JavaScript
var config = {
host: window.location.hostname,
prefix: "/<prefix>/",
port: window.location.port,
isSecure: window.location.protocol === "https:"
};
require.config( {
baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port: "") + config.prefix + "resources"
} );
Example: HTML
<!--Add host to these 3 links if the mashup is on another webserver than qlik sense static content-->
<link rel="stylesheet" href="/<prefix>/resources/autogenerated/qlikui.css">
<link rel="stylesheet" href="/<prefix>/resources/assets/client/client.css" media="all">
<script src="/<prefix>/resources/assets/external/requirejs/require.js"></script>
Example: Update mashup templates with correct prefix
Tip noteIf you do not want to add the prefix every time you create a new mashup you can change the templates so they contain the correct prefix.
-
Locate the mashup template. In this example we are updating the basic mashup template with absolute positioning:
- For Qlik Sense: %ProgramData%\Qlik\Sense\Repository\Extensions\Templates.
- For Qlik Sense Desktop: %Documents%\Qlik\Sense\Extensions\Templates.
-
Open and edit mashup-template.js:
var config = { host: window.location.hostname, prefix: "/<prefix>/", port: window.location.port, isSecure: window.location.protocol === "https:" }; require.config( { baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port: "") + config.prefix + "resources" } );
Save the file.
-
Open and edit mashup-template.html:
<!--Add host to these 3 links if the mashup is on another webserver than qlik sense static content--> <link rel="stylesheet" href="/<prefix>/resources/autogenerated/qlikui.css"> <link rel="stylesheet" href="/<prefix>//resources/assets/client/client.css" media="all"> <script src="/<prefix>//resources/assets/external/requirejs/require.js"></script>
Save the file.
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!