Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: RFC: core attributes
etc wrote #302581:
It could be me not understanding as well :-) I mean, do you expect identical results for
<txp:if_article_category not:name="cats,dogs" number="2" />...
and for
<txp:if_article_category name="cats,dogs" not:number="2" />...
or they mean
Category2 is neither 'cats' nor 'dogs'
andCategory1 is 'cats' or 'dogs'
, respectively?
On my side I’d vote for the second meaning.
Offline
Re: RFC: core attributes
NicolasGraph wrote #302591:
Would it be that bad to do something like
wraptag = wraptag ?: 'p'
after attributes extraction to set the default value of these special attributes?
And what would we do with this default value? Pass it to both tags and the parser? It would give
<p><p>content</p></p>
Pass it to tags only? Not all of them understand wraptag
. Pass it to the parser only? Then the wraptag
-aware tags would use their default wraptag
and we’ll get a double wrap again.
Currently tags attributes are not registered, so the parser has no idea of which road to take.
Offline
Offline
Offline
Re: RFC: core attributes
I’m not adding anything of value to this thread, but I’m really excited about the recent increase in activity with etc and makss getting more involved.
Sending appreciativeness via the intertubes, y’all.
Offline
Re: RFC: core attributes
etc wrote #302597:
And what would we do with this default value? Pass it to both tags and the parser?
I’m dumb, we would pass wraptag=""
to the tag and wraptag="p"
to the parser. Just need to tell lAtts()
not to complain about “unknown” core tags, but this should be easy. Thanks, Nicolas, great idea!
gaekwad wrote #302609:
I’m not adding anything of value to this thread, but I’m really excited about the recent increase in activity with etc and makss getting more involved.
Thanks, Pete, your excitement adds a real value to this thread. :-)
Offline
Re: RFC: core attributes
etc wrote #302560:
But if we had
not
attribute, it could be
<txp:if_individual_article #not>...
Or…
<txp:not:if_individual_article>...
Offline
Re: RFC: core attributes
ruud wrote #302619:
Or…
<txp:not:if_individual_article>...
how would you do this though?
<txp:if_article_list>
<txp:if_section name="">
<!-- you are on the default section/front page -->
<txp:else />
<!-- you are on another section -->
<txp:if_category>
<!-- you are in a category with a list of articles -->
<txp:else />
<!-- you are on an individual article -->
</txp:if_category>
</txp:if_section>
</txp:if_article_list>
Untested but you get my drift.
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: RFC: core attributes
Bump, we need a name! Or should we reserve few special attributes (wraptag, class, label, labeltag, not, ...
) exclusively for core usage, hoping that there will be no clashes with plugins?
Offline
Re: RFC: core attributes
etc wrote #302799:
Bump, we need a name! Or should we reserve few special attributes (
wraptag, class, label, labeltag, not, ...
) exclusively for core usage, hoping that there will be no clashes with plugins?
If i understand this correctly, reserving those attributes only for core usage will definitely break a number of plugins.
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: RFC: core attributes
colak wrote #302800:
If i understand this correctly, reserving those attributes only for core usage will definitely break a number of plugins.
I would be curious to see an example. The idea is to delegate wraptag="ul"
(say) to core, and pass wraptag=""
to plugins. If they interpret it as “no wrap”, it should be ok… unless there are also html_id
, atts
and other wrap attributes… which we could reserve for core too, but it becomes risky, right?
Offline