Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Document Extension: CSS Images

Hey All,

I'm creating a document extension to change some of the CSS of a document and am running into a problem.

I can refer to images from the internet, but cannot figure out how to refer to images in my extension folder.

For example this would work:

.QvCaptionIcon.caption-icon-16x16.caption-SEARCH-dark-icon{

    background-image: url(https://www.example.com/magnifier.png);

}

But the case where I want to reference an image local to the extension/server does not:

.QvCaptionIcon.caption-icon-16x16.caption-SEARCH-dark-icon{

    background-image: url(mag2.png);

}

OR

.QvCaptionIcon.caption-icon-16x16.caption-SEARCH-dark-icon{

    background-image: url(MyExtension/mag2.png);

}

Has anyone else run into this?

THANKS!

1 Solution

Accepted Solutions
Alexander_Thor
Employee
Employee

Sure,

You would reference them like this:
/QvAjaxZfc/QvsViewClient.aspx?public=only&type=document&name=Extensions/<ExtensionName>/<ImageName>.png

View solution in original post

4 Replies
jesper_bagge
Contributor III
Contributor III

Hi Ken,

You can refer to stuff (i.e. css sheet) in your doc ext. folder like this:

var path = Qva.Remote + "?public=only&type=Document&name=Extensions/YOUR_DOC_EXT_FOLDER/";


Qva.LoadCSS(path + "style.css");


Kind regards

Jesper Bagge

Not applicable
Author

Sorry, maybe I wasn't clear enough in my initial post.  Your example works great in a .js file, but does not work inside the .css file, which is what I am trying to do.  Any ideas how to reference images local to an extension from within the .css file?

Thanks!

Alexander_Thor
Employee
Employee

Sure,

You would reference them like this:
/QvAjaxZfc/QvsViewClient.aspx?public=only&type=document&name=Extensions/<ExtensionName>/<ImageName>.png

Not applicable
Author

This worked perfectly!!  Thank you!