Help talk:Tree format
sep seems not to work for tree format
Hi everyone,
using the tree format with SRF 1.7.1, I get results like this:
- result (prop1prop2prop3)
So the properties printed in the brackets are not separated at all. I tried to use the parameter
|sep=,&nbps;
but it did not prove to have any effect.
Is this a bug or a case of misconfiguration? Any help appreciated!
PS I can see a bunch of fantastic new formats having come with SRF 1.8, really looking forward to using them. Thanks to all contributors! Argi (talk) 10:46, 19 December 2012 (UTC)
- So far I have not used this result format though I am looking forward to. Hmm, just by looking at the documentation it should work to get a separator in there somehow. Did you just try
|sep=,to see what happens? [[kgh]] (talk) 01:15, 20 December 2012 (UTC) - Hi Argi, I reworked the treeview format lately. I did not specifically target this bug, but it could well have been solved in the process. Could you try if it works in the latest development version of SRF and if not raise a bug in [1]? Stephan Gambke (talk) 20:25, 13 May 2013 (UTC)
Tree format and subobjects - link to parents doesn't work
Hi all,
I stumbled upon a problem with the tree format, perhaps somebody here can help me. I use MW 1.23.2, SMW 2.0 and SRF 1.9 alpha.
As an example, I store locations in my wiki. For locations with a lot of information, I create a page, for locations with only some semantic data, I only create a subobject. The sematic attributes are the same for both. Both have the attributes "name is" and "located in".
I'd like to use the tree format to display a hierarchy of the places. I use the following query:
{{#ask: [[name is::+]]
| ?name is
| format=tree
| parent=located in
}}
All locations are found and listed, regardless if its only a subobject or not. However, the link with "located in" doesn't work with subobjects: If the parent is a subobject, its children are not listed below it. Is there any way to fix this?
Thanks in advance for your support! Tobias.r (talk) 09:43, 28 August 2014 (UTC)
SRF Tree fails in combination TreeAndMenu Extension and template
The following tree works as expected
{{#tree:id=ProcessTree|root=Processes|
{{#ask:[[Category:Process]][[Is Part Of::+]]
|format=tree
|parent=Is Part Of
}}}}
When adding a template= parameter, the first tree item is rendered outside the TreeAndMenu structure
{{#tree:id=ProcessTree|root=Processes|
{{#ask:[[Category:Process]][[Is Part Of::+]]
|format=tree
|template=SrfProcessTree
|parent=Is Part Of
|link=none
}}}}
The SrfProcessTree template is a simple {{{1}}}
SMW 1.8.x, MW 1.19.x, SRF 1.8/latest SRF_tree.php from git
Can someone confirm that? Alexander Gesinn (talk) 17:45, 12 December 2014 (UTC)
Can't confirm, but what happens if you try it like this:
{{#tree:id=ProcessTree|root=Processes|<nowiki/>
{{#ask:[[Category:Process]][[Is Part Of::+]]
|format=tree
|template=SrfProcessTree
|parent=Is Part Of
|link=none
}}}}
Stephan Gambke (talk) 18:07, 12 December 2014 (UTC)
Limit Depth
Can the depth of the tree be limited? Alexander Mashintalk 06:49, 13 September 2016 (UTC)
Tree format query does not render as a nested list
Hi everyone,
I'm a bit of a SMW beginner and I was just recently playing around with this result format.
Unfortunately, I don't seem to understand how it is supposed to work.
If I take the example query from the help page and substitute Category:Place with Category:City, it just renders a plain, old unordered list without any nesting.
Example:
{{#ask: [[Category:City]] [[Located in::+]]
| format = tree
| parent = Located in
| limit = 5
}}
Result:
Shouldn't the cities be grouped by country, or am I misunderstanding something here? Or do I need to include the parent pages in the query somehow? Blackice (talk) 13:46, 7 November 2017 (UTC)
- The issue is that the countries e.g. Netherlands are not assigned to the "City" category. In your query you are asking for pages which are in the category "City" only. Have a look at more examples in the sandbox wiki. [[kgh]] (talk) 14:05, 8 November 2017 (UTC)
Thanks for the reply. Seems like I overestimated what a result format can do.
Including a country in the query does indeed have the desired effect:
{{#ask:
[[Germany]]
OR
[[Category:City]] [[Located in::Germany]]
| format = tree
| parent = Located in
| limit = 5
}}
Result:
- Some result formats indeed need a special data structure to work on. Here it appears more to be a matter of selecting pages. Have a look at inferencing too. [[kgh]] (talk) 21:27, 8 November 2017 (UTC)