Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2016-11-03 09:01:02

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

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' and Category1 is 'cats' or 'dogs', respectively?

On my side I’d vote for the second meaning.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#14 2016-11-03 09:09:54

etc
Developer
Registered: 2010-11-11
Posts: 5,054
Website GitHub

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

#15 2016-11-03 09:12:40

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: RFC: core attributes

etc wrote #302597:

Currently tags attributes are not registered, so the parser has no idea of which road to take.

Of course, you’re right!


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#16 2016-11-03 09:13:15

etc
Developer
Registered: 2010-11-11
Posts: 5,054
Website GitHub

Re: RFC: core attributes

NicolasGraph wrote #302594:

On my side I’d vote for the second meaning.

Me too, but the parser has no idea of what number or not:number means for each tag. It’s only the tag itself who knows what to do with number.

Offline

#17 2016-11-03 12:09:31

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

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

#18 2016-11-03 16:15:30

etc
Developer
Registered: 2010-11-11
Posts: 5,054
Website GitHub

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

#19 2016-11-03 16:57:04

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#20 2016-11-03 17:26:40

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,012
Website GitHub Mastodon Twitter

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

#21 2016-11-03 21:12:14

etc
Developer
Registered: 2010-11-11
Posts: 5,054
Website GitHub

Re: RFC: core attributes

ruud wrote #302619:

Or…

<txp:not:if_individual_article>...

This is fine for binary attributes, but what if we need to set a value?

Offline

#22 2016-11-09 11:55:20

etc
Developer
Registered: 2010-11-11
Posts: 5,054
Website GitHub

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

#23 2016-11-09 12:18:58

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,012
Website GitHub Mastodon Twitter

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

#24 2016-11-09 12:29:42

etc
Developer
Registered: 2010-11-11
Posts: 5,054
Website GitHub

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

Board footer

Powered by FluxBB