wmk

but frontend theme is set in the config, so you should be able to grab it from there

wmk

I normally hardcode this stuff in my projects, e.g. "themes/foo/images/foto.png"

👌 (1)
wmk

does it really have to be dynamic?

magda

@wmk ahhh, thanks.. and how do I get the current <theme-name> ?

wmk

you should use ResourceURL instead @magda, see http://www.silverstrip.es/blog/ss4-replacement-for-good-ol-themedir-or-loading-themed-resources/ Also make sure you include an absolute URL to the image, if you don't send the image as attachment

andante

if you are accessing themes from the CMS, you need to add that theme to admin_themes

magda

Hi there, I have an email template and want to add an image of my themes-folder. Unfortunately the link $ThemeDir/images/header.png is not working because the $ThemeDir links to /silverstripe/admin/themes/cms-forms . When I use $ThemeDir inside my ThemesFolder, the link is correct /resources/themes/default Am I missing something? In some other Projects it's working fine