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

XF 1.2 Setting scalar @customStyleProperty inside of a template

brstrm

Active member
#1
Hi there,

I am wondering if there exists a way to conditionally set a custom, scaler style property ( Number (with or without units)
) within an actual template such as
<xen:if is="@somethingIsTurnedOn">
<xen:set var="@customStylePropery">1</xen:set>
</xen:if>
 

Steve F

Well-known member
#3
Looks he may be trying to turn on an option if the one comes back as true/on. I'm not familiar with <xen:set> so I'm not sure.
 

brstrm

Active member
#4
Hello,
Thank you for the reply, and sorry for the delay in getting back to you.

Allow me to rephrase my question. I want to construct a variable whose value is calculated from two other variables. Specifically, I want to create a variable called @navigationHeight, and I want its value to be calculated as such:
@navigationHeight = {xen:calc '@headerTabHeight + @tabLinksHeight'}

I've created a tabLinksHeight variable. However, I've also have a setting which removes tablinks called @removeTabLinks.

Basically, I want the calculated value of @navigationHeight to reflect the height of the navigation as displayed on the front end (since @tabLinksHeight value remains 40px (or such) no matter if tablinks are displayed or not).

Something along the lines of @navigationHeight = {xen:calc '@headerTabHeight <xen:if is='!@removeTabLinks> + @tabLinksHeight </xen:if>'}

Horrible syntax, I know. This is part of what is ailing me. : )

Yes, it may seem silly, but this @navigationHeight variable I wish to build will come in useful for such things as absolute positioning of the QuickSearch. Ultimately, I am going through all of this trouble to build a toggleable setting for multiple QuickSearch positions, which must behave how I want whether the tablinks are present or not.

Thanks again for all your support! Truly appreciated!
 
Last edited: