Fixed Template Modifications system can't access style properties.

CyberAP

Well-known member
If I try to call custom style property in TM it causes an error. It doesn't depend on a variable type.
 

CyberAP

Well-known member
I created an addon, created new style property group for it. Then I made a TM:

Template 'editor_contents.css'

Find:

Code:
}

body
{
Replace:

Code:
<xen:if is="@readactor_enabled">
<xen:include template="readactor_editor_contents.css" />
</xen:if>
}

body
{
@readactor_enabled and readactor_editor_contents.css are both part of the addon.

I get this error: Compiler error (may be from another template modification)
 

CyberAP

Well-known member
I solved this by using extra template that contained my conditional. But I think we shouldn't be restricted only to templates.
 

Mike

XenForo developer
Staff member
You don't. It's sort of just the opposite of the other bug report: right now, you can't use @property short cuts - you need to use the {xen:property} version.
 

CyberAP

Well-known member
You don't. It's sort of just the opposite of the other bug report: right now, you can't use @property short cuts - you need to use the {xen:property} version.
It can be used inside <xen:if is="">, right?
 

Mike

XenForo developer
Staff member
Yeah, @property is mostly just done to expose CSS inside the templates. If you look at what's in the database (or compare templates, for example), it's not actually there.
 

CyberAP

Well-known member
Fixing shortcuts in TM caused their breakage in templates :LOL:
Just try to create a template that contains something like this:

Code:
<xen:if is="@customProp">
Hello world!
</xen:if>
That should throw an error. Using {xen:property} however works fine, but anyway it transforms to a shortcut after a template saving.

So this is not completely fixed. @Brogan if you could help me out a bit please move this thread again to Open Bugs.
 

Mike

XenForo developer
Staff member
Wait, so what you're reporting has nothing to do with the template modifications system? It really should be reported separately then - if I'm understanding correctly, this can be reproduced in 1.1 as well.
 

Mike

XenForo developer
Staff member
I'm still 99% sure what you're explaining happens in 1.1 as well, but it's fixed now - only known, valid properties will be translated to the @propertyName syntax.
 
A

account8226

Guest
I'm still 99% sure what you're explaining happens in 1.1 as well, but it's fixed now - only known, valid properties will be translated to the @propertyName syntax.
Any ideas when you will release that fix ?
 
Top