Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Self-closed form of <txp:if_...> tags
I sometimes use if_variable
tag as 0/1
flag:
<txp:section link='<txp:if_variable name="link" value="yes">1<txp:else />0</txp:if_variable>' />
I suggest that we allow if_variable
(and other if_
tags) be self-closed, so <txp:if_variable name="link" value="yes" />
returns 1
or 0
. We could then write just
<txp:section link='<txp:if_variable name="link" value="yes" />' />
Offline
Re: Self-closed form of <txp:if_...> tags
etc wrote #301728:
I sometimes use
if_variable
tag as0/1
flag:
<txp:section link='<txp:if_variable name="link" value="yes">1<txp:else />0</txp:if_variable>' />...
I suggest that we allow
if_variable
(and otherif_
tags) be self-closed, so<txp:if_variable name="link" value="yes" />
returns1
or0
. We could then write just
<txp:section link='<txp:if_variable name="link" value="yes" />' />...
Looks logical to me.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Offline
Re: Self-closed form of <txp:if_...> tags
+1 – I think this will be very handy
Offline
Re: Self-closed form of <txp:if_...> tags
@etc,
Did you cause this little weirdness with that commit?
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Self-closed form of <txp:if_...> tags
phiw13 wrote #302495:
@etc,
Did you cause this little weirdness with that commit?
Yeah, did it again :-( if_plugin
was affected too, now should be fixed, thanks!
Offline
Re: Self-closed form of <txp:if_...> tags
etc wrote #302497:
Yeah, did it again :-(
if_plugin
was affected too, now should be fixed, thanks!
Oups :-) Now works as expected.
I still need to wrap my around what new goodies those self closing <txp:_if… />
will bring to the table.
if you have time, a (long winded…) blogpost or so would be appreciated !
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Self-closed form of <txp:if_...> tags
phiw13 wrote #302499:
I still need to wrap my around what new goodies those self closing
<txp:_if… />
will bring to the table.
if you have time, a (long winded…) blogpost or so would be appreciated !
It’s just an easier-to-parse shortcut for <txp:if_tag>1</txp:if_tag>
. For example
<txp:comments_invite textonly='<txp:if_comments_disallowed />' />
looks (and parses) better than
<txp:comments_invite textonly='<txp:if_comments_disallowed>1</txp:if_comments_disallowed>' />
And when we’ll have a universal core txp:not
(say) attribute, this will be possible too:
<txp:section_list wraptag="ul" break="li">
<txp:section title="1" link='<txp:if_section txp:not name=''<txp:section />'' />' />
</txp:section_list>
Offline