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

XF 2.0 Access options in template

XFA

Well-known member
#1
Hi,

I have a question regarding the .less templates.
Is it possible to use the options inside them, tried so far but seems not possible unless I am missing something ?

I am trying to get the value of an option and set a width attribute using the option value + a 5px additional space.

Clément
 

Chris D

XenForo developer
Staff member
#2
It is possible, in the same way as any other template:
Code:
{$xf.options.theOptionId}
Though that kind of syntax in .less templates does all kinds of ugly things. So you might want to do what we do in attachments.less:
Less:
@_attach-thumbSize: xf-option('attachmentThumbnailDimensions', px);