[opencms-dev] Images dont appear on html page after export in OpenCms

Schliemann, Kai K.Schliemann at comundus.com
Tue Sep 9 12:41:06 CEST 2014


Hi Sharad,
you have to define your images with relative path in your template and you also have to use the <cms:link> tag for them.
e.g.
<img src="<cms:link>/system/modules/my.module.path/resources/images/image.png</cms:link>" />

If you want to use relative paths, you have to change your  import-export.xml like <userelativelinks>true</userelativelinks>.

Note: When using <userelativelinks>false</userelativelinks> relative links in css files (e.g. for background images) work, whereas relative paths in JS files do not work.
I never used relative link setting in OpenCms, so I cannot tell, how good it works.

If you still have problems, send us a extract of the generated html source, where an image path can be seen.

Best regards
Kai

-----Ursprüngliche Nachricht-----
Von: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] Im Auftrag von Sharad
Gesendet: Dienstag, 9. September 2014 12:05
An: opencms-dev at opencms.org
Betreff: [opencms-dev] Images dont appear on html page after export in OpenCms

Hi All,

In file import-export.xml below is the setting:
<defaultpropertyvalue>true</defaultpropertyvalue>

<staticexporthandler>org.opencms.staticexport.CmsAfterPublishStaticExportHan
dler</staticexporthandler>

<staticexport enabled="true">

All html files after publish are getting exported to the hard drive except the images don't appear on the files.
Images don't appear when we give relative path of the image in the template.
Same image appears when we give an url of the image in img-src tag in template.

Thanks and Regards,
Sharad

_______________________________________________
This mail is sent to you from the opencms-dev mailing list To change your list options, or to unsubscribe from the list, please visit http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev






More information about the opencms-dev mailing list