[tw5] Dynamic class

Hello

I try to make a tabs with a dynamic changeable class tc-vertical and tc-horizontal.
I tried many things the simplest are this two but they didn’t work.
The $tName$ works but class seems to use another render path.

<$macrocall $name=“tabs” tabsList="""[tag[$tName$]nsort[order]]""" class="""$alignment$""" />

<$macrocall $name=“tabs” tabsList="""[tag[$tName$]nsort[order]]""" class="""<>""" />

This generate this HTML code in firefox:

or

Can anyone help to get this working.

Thanks
Thomas

We need to see more of your code.

Syntax like $something$ only works inside a macro. So what are the parameters of the macro? And how is the macro called?

Likewise, a notation like <<alignment>> represents a macro or variable, which has to be defined. If you have such a variable, how is it defined?

Hello Marc
I tested this only the last Test shows the Tabs Vertical

Thanks for your help.


\define testFunction(alignmentTabs:"", tName:"" )
Second Test: <<alignmentTabs>>,$alignmentTabs$

<$macrocall $name="tabs" tabsList="[tag[$tName$]nsort[order]]" class="""$alignmentTabs$""" />

\end

\define dynamicTabs(current:"", tName:"" )

<$set name="alignmentTabs" value="tc-vertical" >
First Test: <<alignmentTabs>>,$alignmentTabs$

<$macrocall $name="tabs" tabsList="""[tag[$tName$]nsort[order]]""" class="""<<alignmentTabs>>""" />
<br/>
<$macrocall $name="testFunction" alignmentTabs="""<<alignmentTabs>>""" tName="""$tName$""" />
<br/>

Last Test:
<$macrocall $name="tabs" tabsList="""[tag[$tName$]nsort[order]]""" class="tc-vertical" />
</$set>
''
\end

<$macrocall $name="dynamicTabs" current=<<currentTiddler>> tName="TableOfContents"/>

Remove the quotes around """<<alignmentTabs>>""". Like this:

<$macrocall $name="tabs" tabsList="""[tag[$tName$]nsort[order]]""" class=<<alignmentTabs>> />
<br/>
<$macrocall $name="testFunction" alignmentTabs=<<alignmentTabs>> tName="""$tName$""" />
<br/>

Many thanks this works!