Hello, In an HTML dialog, if I use either of the following instructions for importing a style:
or
the CSS file is loaded (see line #1 below) with the request attribute "?ln=xpertivy-14-WebContent". Unfortunately, it cannot find the images defined in the CSS (see 2 last lines). Notice that the request attribute above is not appended to the image request. This could be important because if I manually request the following URL:
I can successfully get the clock24.png image. Is it actually a bug, or is there a particular way to do it? Thanks. asked 18.11.2013 at 17:18 A1234 Flavio Sadeghi ♦♦ |
It should be possible to access images in the webContent folder if you reference the image similar to this in the .css file:
answered 19.11.2013 at 10:01 Peter Stöckli ♦ Had to add url("#{resource['portlet/images/clock24.png']}") - but works like a charm. Thanks. :)
(19.11.2013 at 10:12)
Nikel Weis
This solution is valid if we use an external CSS file whose content is under control. However, if an external 3rd-party JavaScript library or framework is used, it often comes with CSS style sheets and referenced images. If the developer puts these resources in the WebContent folder, I suppose everything will work fine, except for the images referenced by the CSS style sheets. Unless you edit them by hand to fix all image paths located in the 3rd-party style sheets, which is laborious and error-prone.
(19.11.2013 at 13:21)
A1234
1
You can use a regular expression to make this less error prone - something like url((.+)) [search string] and url("#{resource['img:\1']}") [replace string]. Whereas 'img' would be the target folder like Heinrich Spreiter suggested in his tutorial about using ThemeRoller for Xpert.ivy:
(19.11.2013 at 13:51)
Nikel Weis
hi @Peter Stöckli ♦ Can i apply same for js file? it's seem not work.
(07.11.2018 at 03:50)
trungdv
|
It does not seem to be possible to access images within the webContent-folder from an externally loaded style-sheet. Maybe as a workaround: If you are using a PageTemplate, just put your style-definitions using images there. The code would be:
...whereas the prefered way is to put in the CMS.
answered 19.11.2013 at 09:09 Nikel Weis |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 18.11.2013 at 17:18
Seen: 8,922 times
Last updated: 07.11.2018 at 03:50
Hey, where's my question content ?? it is there if I edit, but not shown when published :-(
hi @adriano-labate, it was the http-link. It's a known issue. Just putting two ` round the link and it works...