Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Topic closed
<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
- subcat1.1
- 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
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
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
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
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
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
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
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
Re: <txp:category_list> attribute naming: "shallow" or "children"?
Offline
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
Pages: 1
Topic closed