XF 2.2 using Assets in templates

DohTheme

Well-known member
Hello,

I've created the Asset location name "dt_files_path" and defined its path.
I used it in style properties as %ASSET:dt_files_path% and it works perfectly but when used it in "extra.less" template with this class:

CSS:
.bodyPattern_overlay__bottom::before
{
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgb(21,29,32) 100%), url("asset('dt_files_path')/img/pattern.png");
    background-repeat: repeat;
    background-position: center center;
    z-index: -2;
}
It doesn't work :( so why this?
 
Try:

Code:
.bodyPattern_overlay__bottom::before
{
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgb(21,29,32) 100%), url("{{ asset('dt_files_path') }}/img/pattern.png");
    background-repeat: repeat;
    background-position: center center;
    z-index: -2;
}
 
I set the Asset path to "styles/joy" in the local server but when importing it to the demo it changes to "data://styles/145/styles/joy"
why does this happen?
 
The purpose of asset paths is to allow them to be able to be pointed at different locations and still work. Notably, not all servers allow write access outside of the internal_data and data directories, so we always place assets within those paths when the style is imported as a zip.
 
Top Bottom