Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-11-21 14:13:31

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

<txp:category_list> attribute naming: "shallow" or "children"?

Assume we have these categories:

  • category1
    • subcat1.1
    • subcat1.2
  • category2

Now instead of displaying all those categories using <txp:category_list> (which is the default behaviour), we want to show only this:

  • category1
  • category2

How should the attribute controlling this behaviour be named:

Wet says: <txp:category_list shallow="1" />
Ruud says: <txp:category_list children="0" />

Now assume we have these categories:

  • category1
    • subcat1.1
      • subcat1.1.1
      • subcat1.1.2
    • subcat1.2
  • category2

And we only want to display these (category_list displays a flat, non-nested list at all times):

  • category1
  • subcat1.1
  • subcat1.2

Wet says: <txp:category_list parent="category1" shallow="1" />
Ruud says: <txp:category_list parent="category1" children="0" />

While the developers themselves will understand it either way, the real question is: which of the attribute names (shallow vs children) is the easiest to understand instinctively for the average user?

Wet argues in favour of using “shallow”: The list always descends into the first generation of descendants (“children”), but “shallow” inhibits any further descension (“grandchildren” and “dynasty” level).
[parent => child => grandchild]

Ruud argues in favour of using “children”: The attribute name “children” conveys more specific what it’s meaning is, while “shallow” is a more generic term and could also be a reference to the display method (flat list or nested) and it doesn’t specify to which level the categories are limited (how shallow). Using “children” instead assumes that each category has a parent and can have children.
[parent <= category => child]

Offline

#2 2008-11-21 15:03:59

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,822
Website GitHub

Re: <txp:category_list> attribute naming: "shallow" or "children"?

I love a good bun fight ;-)

I might have missed the point here, but on the surface I’m kind of leaning towards children. I think it gives more scope for expansion. For instance, would it give the possibility in future for doing:

<txp:category_list parent="category1" children="3" />

Thus displaying just 3 levels of category below category1 (assuming there are that many nested levels of course) and going no further? Of course, you’d then have to have children=“all” (or something) if you didn’t care how many levels it traversed.

Edit: I assume at the moment it’s a boolean choice: children=“1” is the default and shows all children, while children=“0” inhibits any children being displayed? In that case, expansion is not possible as the idea of going down N levels would break existing (4.0.7) implementations, so maybe that’s not such a hot idea. Either way, ‘children’ seems to fit my way of thinking.

Last edited by Bloke (2008-11-21 15:09:49)


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

#3 2008-11-21 15:19:44

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: <txp:category_list> attribute naming: "shallow" or "children"?

as a not too techie user, i’d vote against shallow, it’s not clear.
children is an opstion, others that come to mind are:
<txp:category_list parent=“category1” descendants=“0” />
<txp:category_list parent=“category1” subcategories=“0” />


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#4 2008-11-21 17:12:56

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: <txp:category_list> attribute naming: "shallow" or "children"?

Or “childlevel” or “child_level” or “child-level” thinking back to Stef’s post, but if there are no future plans to be able to specify the number of levels to display then go with “children”.

Last edited by thebombsite (2008-11-21 17:18:06)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#5 2008-11-21 18:13:46

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: <txp:category_list> attribute naming: "shallow" or "children"?

I vote for children :)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#6 2008-11-21 18:27:11

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: <txp:category_list> attribute naming: "shallow" or "children"?

I would go for children, because it is understood that a child comes from a parent. Shallow is less clear for me.

Offline

#7 2008-11-21 18:33:57

monkeyninja
Plugin Author
From: Sheffield, UK
Registered: 2008-10-14
Posts: 239
Website

Re: <txp:category_list> attribute naming: "shallow" or "children"?

Another vote for ‘children’ here. ‘Shallow’ is likely to cause confusion. The fact that a child has a parent is a lot more obvious than shallow having a parent!

Offline

#8 2008-11-21 19:53:01

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: <txp:category_list> attribute naming: "shallow" or "children"?

+1 for Children.

I like Blokes idea of children="3" to specify the number of levels.
If it’s a boolean choice and needs to be on/off – then how about a “levels” attribute?

Offline

#9 2008-11-21 20:33:18

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,357
Website GitHub Mastodon

Re: <txp:category_list> attribute naming: "shallow" or "children"?

Offline

#10 2008-11-21 21:06:07

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: <txp:category_list> attribute naming: "shallow" or "children"?

Robert,

U.S. democracy doesn’t work like that – you can’t just concede the point.
You have to contest the results, insist there was voter fraud, demand a recount, file suit against anyone and everyone,
…then claim victory in the face of all logic.

Hope that helps.

:)


Tom

Last edited by renobird (2008-11-21 21:07:30)

Offline

#11 2008-11-21 21:11:31

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Re: <txp:category_list> attribute naming: "shallow" or "children"?

children

Offline

Board footer

Powered by FluxBB