1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lack of Interest @imagePath variable

Discussion in 'Closed Suggestions' started by Mike Creuzer, Oct 6, 2010.

  1. Mike Creuzer

    Mike Creuzer Well-Known Member


    In every template, so it would seem, you have added the name of the default skin in every folder.

    In other words, you have stored "@imagePath" as "default". This concept is nice. However, what you seem to have done is hardcoded the "second directory" into ALL the CSS and templates. That folder is "xenforo".

    So, lets recap. An image such as a gradient would be found here in the css displayed like this:

    background: url('@imagePath/xenforo/gradients/grad.png');

    Why not store '/xenforo' in the @imagePath variable? So now, if I want to use some of the gradients (which is natural, considering the amount of CSS and HTML there would be needed to edit this), I have to make my skin directories like so:

    @imagePath = "MY_SKIN/xenforo"

    I mean, this will work, but what is the point of adding in that random xenforo directory? Is there a point to it? Are there blog/cms/etc features coming where this would be needed?

    My suggestion is to make the entire image path changeable, not just the first folder. As there is no point for the second one (at least as far as I know).

    Thank you,
    Mike Creuzer
  2. ToDie4

    ToDie4 Well-Known Member

    Sorry to revive an old thread!

    This is something I have just logged in to put forward, I was quite surprised to see it suggested already yet not implemented!

    Suppose we have it so all styles must be uploaded to the default style folder where the xenforo style folder is located, like so:

    then cannot the image path then be set to:

    Then in the css files we would no longer see this:

    But instead we would see this:

    We would not have to edit css files when using customised graphics in place of the default graphics, I know we could add the definitions to the EXTRA.css but this seems redundant when all we should need to do is be able to add the image path as described above.
    This would help enormously when updates come around, having the default css files untouched makes the update process run so much more smoothly, and of course it avoids the problems of potential end-user errors getting into the css files.
  3. Kier

    Kier XenForo Developer Staff Member

    The 'xenforo' part refers to the product. If you release an add-on called 'MyAddOn', we would expect your images for that add-on to be located in @imagePath/myaddon/ rather than @imagePath/xenforo/
  4. Floris

    Floris Guest

    I find this to be a wonderful development and insight into engineering a product.

    XenForo, the forum product.
    XenBlog, the blog product.

    Integration && Framework! Epic Win.

    Style used: id has 1.

    Directory: /styles/default/ -> @imagePath
    When going to the blog or the forum, use default directory, and load appropriately:

    Benefit, users who only have the forum product, won't have to upload 1mb in .png images for the blog
    Another benefit, users who load the blog, would already have most of the style from the forum (core product) in the cache, etc, and additional new 'specific to blog' images can now be called.
    And there's no need to put the xenforo images inside the xenforo blog directory as well, and visa versa.
  5. ToDie4

    ToDie4 Well-Known Member

    So I am just going to have to edit loads of css files then, not happy with that at all.
  6. Floris

    Floris Guest


    I don't see why you should have to.

    Every style can be it's own @imagePath
    The @ indicates it's a style property, .. and style properties are per style.
  7. ToDie4

    ToDie4 Well-Known Member

    Can you tell me how to enter the right style path then please Floris, because it's not clear to me at all.

    Suppose I have my style in styles/robotic

    What should i have in the image path?
  8. Kier

    Kier XenForo Developer Staff Member

    'styles/robotic'. Any images that replace the existing ones must live in a 'xenforo' subdirectory. Any that are unique to your style and do not replace existing ones can live wherever you want them to.
  9. ToDie4

    ToDie4 Well-Known Member

    I see, so supposing I wanted to replace the existing avatar_m.png, which is ordinarily found in:

    where should I store the replacement avatar_m.png if I wanted it available only for the robotic style?
  10. Brogan

    Brogan XenForo Moderator Staff Member

    In the corresponding folder for that style: styles/robotic/xenforo/avatars/avatar_m.png
    ToDie4 likes this.
  11. ToDie4

    ToDie4 Well-Known Member

    Brilliant, thank you very much. :)
  12. ToDie4

    ToDie4 Well-Known Member

    I must be doing something wrong here, I have set the path to styles/robotic and things seemed just dandy, but I noticed some little graphics were missing, looking through the style properties I am seeing numerous calls to @imagePath/xenforo/*whatever*, so this is forcing me to add all of the original xenforo images that are called in the style properties to the robotic/xenforo folder, bit strange.

    Am I doing something wrong here?
  13. Kier

    Kier XenForo Developer Staff Member

    No, that is how the system is designed.
    ToDie4 likes this.
  14. ToDie4

    ToDie4 Well-Known Member

    Got it, thank you Kier. :)

Share This Page