Image directory for a style

  • I have added a new style which is a variant of default theme. I made a duplicate of default theme from ACP and modified it from there. The issue I am currently facing is, all my input URLs for images directory for the style are getting rejected.


    /wcf/images/smart


    is the directory I want to use. What should be my input in the box which says " Image Path " in style settings. It says


    Quote

    Path for optional images for your style, directory should be located within “images”.

    Smile , it's good for health

  • I used images/smart . But when I tried to add a background image, I was forced to create wcf/style/images/smart

    Smile , it's good for health

  • Thanks @PJK , that what I used. But, I had to use wcf>style>images>smart to get my background image detected. I am confused now. :(

    Smile , it's good for health

  • Thanks @PJK , that what I used. But, I had to use wcf>style>images>smart to get my background image detected. I am confused now. :(

    Put your images in a wcf/images/smart folder and use something like this in the styles advanced css section:


    background: url("@{style_image_path}background.png") repeat;

  • That's what I did. Then I used inspect element and found that the image is being pulled from within the style directory. so, I had to use that path instead.

    Smile , it's good for health

  • That's what I did. Then I used inspect element and found that the image is being pulled from within the style directory. so, I had to use that path instead.

    Have you changed this at all @{style_image_path}? It should look exactly as it is there.

  • I didn't get you. What will be the image path if we use a folder smart under wcf > images ?

    Smile , it's good for health

  • The variable @{style_image_path} resolves to the relative path for your style's image folder. The compiled CSS will be placed in wcf/style/ and if your folder is called smart, then the variable will point to ../images/smart/. This is the whole point of using the variable, to not care about relative or absolute paths and still be able to use them easily.

    Alexander Ebert
    Senior Developer WoltLab® GmbH

  • The variable @{style_image_path} resolves to the relative path for your style's image folder. The compiled CSS will be placed in wcf/style/ and if your folder is called smart, then the variable will point to ../images/smart/. This is the whole point of using the variable, to not care about relative or absolute paths and still be able to use them easily.


    Thank you @Alexander Ebert . Got it, I guess. :)

    Smile , it's good for health