Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Offline
Re: Making your plugins 4.7-aware
NicolasGraph wrote #313030:
Because the tag could be used by its own as a container, I uses
return parse($thing, $out), however, its triggers an error when$outisfalse.
Thanks, this error is weird, will investigate.
Doing
return $out ? $thing : '';does work but it would not parse potentialelsecontents.
You can not make global attributes work this way atm, because the $thing they get is generally already parsed (by the tag) and does not contain <txp:else /> anymore. We could (will?) introduce {pre}parsing global attributes, but, in this case, there would be an ambiguity re the false part in, say
<txp:if_something if_something_else>...<txp:else />...</txp:if_something>
In my case I could check if the tag was used through the global attribute to conditionate the return, but it could be a problem if the global attribute wouldn’t have its own name I guess.
I don’t know if the parser should manage this kind of use or not, or if, has I aked before, there should be a convention about global attributes to name them differently than others; in which case checking the use of a global attribute could seem alright.
When the parser processes global attributes, $pretext['_txp_atts'] is set to true. You can check it, though this may change one day.
Offline
Re: Making your plugins 4.7-aware
etc wrote #313037:
Thanks, this error is weird, will investigate.
Ok, thanks.
You can not make global attributes work this way atm, because the
$thingthey get is generally already parsed (by the tag) and does not contain<txp:else />anymore. We could (will?) introduce _pre_parsing global attributes, but, in this case, there would be an ambiguity re thefalsepart in, say
Yes, I understand, I was just saying that return $out ? $thing : ''; would obviously not work if used through the tag with a potential else clause. I don’t try to use any else clause through the global attribute.
When the parser processes global attributes,
$pretext['_txp_atts']is set totrue. You can check it, though this may change one day.
Noted.
Offline