Style property to set a default asset location per style (and generic asset upload function)


XenForo moderator
Staff member
Currently it isn't possible to force assets into a particular directory when uploading via the ACP - the paths are hard coded.

So if you have two styles and you upload a logo.png for each one, the first will be uploaded to data/assets/logo/logo.png and the second will also be uploaded to data/assets/logo/logo.png , overwriting the first one.

Assets must be uniquely named across styles to avoid this - e.g. style-1-logo.png, dark-style-logo.png .

Of course this isn't an issue if you have access to the server files, as you can create custom directories and manually upload the files to them, then set the paths in the style properties.

However, cloud installations won't have server/file access.

It would be useful to be able to define a custom asset path per style, with a default path used (based on the style ID) if not defined.

So style 1 (no path set) would use data/assets/style-1/logo/logo.png and style 2 (custom path set) would use data/assets/dark-style/logo/logo.png .

This default path could also be used for miscellaneous images uploaded via a generic asset upload function, for use in notices, page nodes, custom help pages, etc.
Again, something that wouldn't currently be possible with a cloud installation, without the ability to upload files to the server.
Upvote 4