Categories > TinyButStrong general >

mtype and attribute... again...

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: kapouer
Date: 2006-12-15
Time: 12:02

mtype and attribute... again...

Hello,
regarding xhtml compliance when one wants to use magnet to output/suppress a tag attribute :
i think a very simple solution like this would be nice :
magnet=@ to suppress surrounding attribute.

<a href="toto.html" class="[myfield;magnet=@]">a link</a>

would output
<a href="toto.html" >a link</a>
when myfield is empty.
I guess it's the simplest common case, much easier to implement in TBS than the case where one empty field would suppress another attribute in the same tag, which is, i agree, not fun to code.

(i put @ because it's accessible for anyone, is it really xhtml compliant ? i don't know)

best regards,

Jérémy.

By: Skrol29
Date: 2006-12-16
Time: 03:12

Re: mtype and attribute... again...

Hello,

That's a nice idea.

The next version of TBS i'm working on will probably be able to move a TBS tag into an XML attribute. the goal is to make some XML attributes dynamic even if the template is made in visual mode (OpenOffice for example)
The code i'm testing about that gives good results.
By: RwD
Date: 2006-12-17
Time: 18:03

Re: mtype and attribute... again...

Finally! I think I suggested something like this before. (Although I think I used mtype to specify I was talking about the attribute. But since you cannot nest attributes @ would even be better!)
By: sheepy
Date: 2006-12-21
Time: 12:18

Re: mtype and attribute... again...

It's ugly, but for now I do it like this:
<a href="toto.html"
class="[myfield;magnet=_]"
>a link</a>