XF 2.0 How to edit @imagePath and use it on templates?

James Z

Member
Licensed customer
I'm creating an add-on with common template modifications to be applied on several XF2 sites. Images and other resources paths vary from site to site and, I've seen that I can use @imagePath on templates to set paths dynamically, where can I edit what value is stored in @imagePath?

Thanks
 
Where exactly did you see that?
Anyways, what you want to create is a style property.

I might be confused since this option used to exist in XF1. So can I set @imagePath to /the-path-needed/img.jpg in extra.less and then it'll be called when the CSS is parsed?
 
extra.less is called pretty late IIRC, so that wouldn't work always.
/admin.php?style-properties/add&style_id=0&group=basic
Make sure to assign that property to your addon.
 
Back
Top Bottom