Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
An attribute without any value
Hi,
How about using an attribute without any value (like the multiple attribute of select)?
I’m thinking to use it for attributes which support only on/off values (usually 0/1) or for an attribute which could support any value or no value at all…
Its works as far as I tried but Is there a reason to not do that?
Offline
Offline
Re: An attribute without any value
Hi Nicolas,
Never tried it but I think that you could get a more informed input if you could post some code.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: An attribute without any value
colak wrote #299393:
Hi Nicolas,
Never tried it but I think that you could get a more informed input if you could post some code.
In fact you can take what ever plugin code which use an attribute as a switch, or even the plugin template, my code has nothing special; but I don’t think that it is possible to do what I tried because of the way attributes are built with latts(). I did what I wanted in a more usual way.
Offline
Offline
Re: An attribute without any value
etc wrote #299403:
Hi Nicolas, not sure to understand, could you be more specific?
I was working on an improved version of oui_cookie for Txp 4.6 only; I have a display attribute which is a simple switch like there are in other plugins and I thought it could be nice to be able to do that: <txp:oui_cookie value="my_cookie" display /> instead of <txp:oui_cookie value="my_cookie" display="1" /> but I can’t make it work properly. Doesn’t latts() require a value for each attribute?
Offline
Re: An attribute without any value
NicolasGraph wrote #299404:
Doesn’t
latts()require a value for each attribute?
No, it’s parse() that does not detect <txp:oui_cookie value="my_cookie" display /> as txp tag. It (currently) needs attr="value" pairs. That could be modified, but would be invalid (?) XML-wise.
Offline
Re: An attribute without any value
etc wrote #299405:
No, it’s
parse()that does not detect…
Oh, ok; good to know.
That could be modified, but would be invalid (?) XML-wise.
That’s where I’m starting to get lost; I don’t know XML a lot.
Edit: I think it is what you talk about?
Last edited by NicolasGraph (2016-06-02 09:32:18)
Offline
Pages: 1