Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2021-02-04 07:31:24

etc
Developer
Registered: 2010-11-11
Posts: 4,517
Website GitHub

Re: Display articles only with empty category

amordecosmos wrote #328512:

Hey, that worked! Thank you.

Great, but it’s a shame one has to employ these acrobacies in 2021 for such a natural request. What should we do: allow article_custom set pagination data? let article alter category and other ‘context’ attributes? something else?

Offline

#14 2021-02-04 09:25:45

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,724
Website GitHub Twitter

Re: Display articles only with empty category

etc wrote #328513:

Great, but it’s a shame one has to employ these acrobacies in 2021 for such a natural request. What should we do: allow article_custom set pagination data? let article alter category and other ‘context’ attributes? something else?

I think that it would be great to if we allow article_custom to have pagination data. The tag already has all the other parameters, so it would just be one addition.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#15 2021-02-04 10:06:59

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,474
Website

Re: Display articles only with empty category

etc wrote #328513:

[…] allow article_custom set pagination data? let article alter category and other ‘context’ attributes? something else?

The first certainly gets my vote! When amordecosmos OP popped up, my first reaction was <article_custom not category="catx" />. But but pagination :-(


Where is that emoji for a solar powered submarine when you need it ?

Offline

#16 2021-02-04 10:50:43

etc
Developer
Registered: 2010-11-11
Posts: 4,517
Website GitHub

Re: Display articles only with empty category

colak wrote #328515:

I think that it would be great to if we allow article_custom to have pagination data.

phiw13 wrote #328516:

The first certainly gets my vote!

Feasible, but we’d need to enable it via some attribute, for bw-compatibility sake:

<txp:article_custom exclude category="catx" pageby />

Which looks artificial compared with

<txp:article exclude category="catx" />

What could be wrong with enhancing <txp:article />? If category is not set, pull it from URL as usual.

Offline

#17 2021-02-04 11:14:02

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,520
Website GitHub

Re: Display articles only with empty category

etc wrote #328518:

What could be wrong with enhancing <txp:article />? If category is not set, pull it from URL as usual.

Can’t see any downside to this. Backwards-compatible and a neat enhancement. It brings article and article_custom a little closer, too. Maybe one day we could even have the flexibility of a single <txp:article /> tag that can do everything <txp:article_custom /> can, but employs context sensitivity first as it does now. Mmmmmm.

Last edited by Bloke (2021-02-04 11:21:00)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#18 2021-02-04 11:18:45

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,474
Website

Re: Display articles only with empty category

etc wrote #328518:

Feasible, but we’d need to enable it via some attribute, for bw-compatibility sake:

yeah, OK. I was going with this thinking it might be easier to implement…

What could be wrong with enhancing <txp:article />? If category is not set, pull it from URL as usual.

If you can work around the context-sensitivity issue, then sure!


Where is that emoji for a solar powered submarine when you need it ?

Offline

#19 2021-02-04 16:04:59

etc
Developer
Registered: 2010-11-11
Posts: 4,517
Website GitHub

Re: Display articles only with empty category

phiw13 wrote #328520:

I was going with this thinking it might be easier to implement…

It’s more straightforward, yes, but uglier too.

If you can work around the context-sensitivity issue, then sure!

The only difficulty is to decide on attribute/context interplay.

Offline

#20 2021-02-04 21:20:29

etc
Developer
Registered: 2010-11-11
Posts: 4,517
Website GitHub

Re: Display articles only with empty category

Bloke wrote #328519:

Maybe one day we could even have the flexibility of a single <txp:article /> tag that can do everything <txp:article_custom /> can, but employs context sensitivity first as it does now. Mmmmmm.

Well, maybe not in 4.8.5, unless all subtleties are clear. Meanwhile, it’s possible now to use <txp:article_custom /> as partial substitute for <txp:article />:

<txp:article_custom ...some atts... pageby offset />

Offline

#21 2021-09-06 14:24:48

peterj
Member
From: Melbourne, Australia
Registered: 2005-06-02
Posts: 76

Re: Display articles only with empty category

This thread might explain why I can’t get article_custom exclude to work how I thought it did in 4.7+. In the docs for article_custom it defines the exclude attribute like this:

exclude="article id(s) or field(s)"
Exclude a specific article or list of articles (each ID separated by a comma), or the articles with matching fields (author, category, etc.).

If this “matching field” means the field name or label, not the value, should the doc be revised to say so?

I’d been trying all manner of variations, extending to ```exclude=“field(category1, my-category)”``` and the like.

Offline

#22 2021-09-06 20:17:23

etc
Developer
Registered: 2010-11-11
Posts: 4,517
Website GitHub

Re: Display articles only with empty category

I don’t remember exactly which one, but some combination of

match="category1" exclude="category1" category="my-category"

should work.

Offline

Board footer

Powered by FluxBB