Help talk:Tree format
- [View source↑]
- [History↑]
Contents
Thread title | Replies | Last modified |
---|---|---|
Tree format query does not render as a nested list | 3 | 22:27, 8 November 2017 |
Limit Depth | 0 | 07:49, 13 September 2016 |
SRF Tree fails in combination TreeAndMenu Extension and template | 1 | 19:07, 12 December 2014 |
Tree format and subobjects - link to parents doesn't work | 0 | 12:54, 3 September 2014 |
sep seems not to work for tree format | 6 | 11:49, 27 August 2013 |
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?
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.
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:
Nice :)
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.
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?
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!
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!
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?
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]?