Categories > TinyButStrong general >

Adding a class with att and attadd

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Anthony
Date: 2011-02-24
Time: 22:44

Adding a class with att and attadd

Ok, I am trying to get a handle on how att and attadd work. I tried to do the following to begin with and it did not work.

PHP:
$cssClass = 'firstevent';

HTML:
<div class="eventItemText [onshow.cssClass;att=class;attadd;when [eventsblock.#]=1]">


I then tried the following which did work. I would like to understand why it works this way and if it was intended to work that way. Note that I eliminated the $cssClass in the PHP and now only have the following in the HTML template.

HTML:
<div class="eventItemText[onshow;att=class;attadd;if [eventsblock.#]=1;then firstevent]">
By: Skrol29
Date: 2011-02-25
Time: 11:41

Re: Adding a class with att and attadd

Hi Antony,

Parameter "att" moves the TBS field into the specified attribute. But in your case, the TBS fields is already placed into the attribute, so parameter "att" is useless".
I've also noticed that you've used parameter "when" into a TBS fields, but this parameter is for blocks. It will be ignorer in a field.

The best way to do what you're trying to do is:
<div class="eventItemText"> [eventsblock.#;att=class;attadd;if [val]=1;then firstevent;else '']
By: Anthony
Date: 2011-02-25
Time: 19:02

Re: Adding a class with att and attadd

Ok, now I see and that explains why there was a blank space before the added field. Again, thank you for your help.