Help talk:Displaying information
| |
Talk pages on this wiki should primarily be used to address possible mistakes as well as missing and superseded information in the documentation. |
|
Contents |
Question
Okay... I appear to be missing something.
Let's say we have a page with multiple Has Related Page values. In other words, a one-to-many relationship between pages. If I perform a {{#show query or whatever to return those values, how would I format them into an unordered list? Simply typing format=ul doesn't work, since the values are for the same page. A simple template=whatever doesn't work, since all values are passed as the first argument.
This seems to me like it'd be one of the simplest things for a user to be able to accomplish, and yet I'm unable to find any information concerning it. I figure I'm missing something obvious.
- 68.224.44.77 06:08, 12 August 2010 (UTC)
- The options are actually pretty limited right now, sadly, for displaying multiple values for the same page. What do you mean by "unordered list", though? Yaron Koren 13:48, 12 August 2010 (UTC)
Adding a 'constant' column to the output of a query?
Is there a printout statement for creating an output column containing the same value for every query result? Something like:
{{#ask: [[Category:City]] [[located in::Germany]] | ?population | ?? myConstantValue }}
which would give a table like:
| City | Population | Constant |
|---|---|---|
| Berlin | 3,391,409 | myConstantValue |
| Munich | 1,259,677 | myConstantValue |
| Stuttgart | 595,452 | myConstantValue |
Why would I want to do that? Because I'd like to use a template for formatting, and I want to pass a constant string/page/number to that template as an argument, along with all the query results. The constant value might be {{PAGENAME}}, which would allow that template to know who is wanting the query results formatted. Alternatively, the constant value might be text that goes in front of each query result, allowing one page to pass in * as the constant value, and print the output as a list:
- +1. 178.72.112.204 14:33, 18 June 2011 (CEST)
- Berlin contains 3,391,409 people
- Munich contains 1,259,677 people
- Stuttgart contains 595,452 people
While another page might want to nest the output into a lower-level list by passing in ** as the constant value:
- Germany:
- Berlin contains 3,391,409 people
- Munich contains 1,259,677 people
- Stuttgart contains 595,452 people
If there isn't such a 'constant' printout statement, is there a workaround to send an extra column to a query-display template? Or is there another built-in way to accomplish this that I'm just missing?
quirkster (76.76.146.52 21:05, 3 November 2010 (CET))
- +1. 178.72.112.204 14:34, 18 June 2011 (CEST)
- Workaround: {{#ask:[[Prop::Value]]|format=ul|template=test_constant{{!}}constant=Some constant value}}.
62.231.186.17 05:32, 12 July 2011 (CEST)
Displaying All Information
Is there a way to display all the information about a query?
For example, instead of this
{{#ask: [[Category:Cities]]
|?population
|?area
|?coordinates
}}
is there a way to display all of the properties within a query?
Display Previous and Next Items
I have many pages that are concerts that occur. These have page names that show that date, but there are not pages for every date, only the ones that have concerts. Is there a way to display on a page links to the Previous and Next date pages that do exist, using an inline query or similar?
modify the examples
Hi everyone! I think it's possible to make this page more clear if use ask-queries as an examples or provide screenshots of Special:Ask and links to it. In this case the reader will have some idea of how to use printout statements even if she hasn't read anything else. Can I try to modify the page with this? Yury Katkov 06:16, 11 January 2012 (CET)
- Yeah, I think so too. Would you start at the Russian page for me to see what you are exactly thinking about? Cheers --[[kgh]] 12:41, 11 January 2012 (CET)
- Sure, I'm translating this page to Russian right now. Yury Katkov 06:09, 12 January 2012 (CET)
Show only X chars of a text value
Hi. I use Text properties, which are very long. How can I show only 100 bytes, 200, etc, instead of the entire value? Emijrp 13:44, 22 January 2012 (CET)
- Good question. Nice to know if and how this may be achieved. Currently I cannot think of a solution. Perhaps you might want to try the user mailing list. Cheers --[[kgh]] 14:42, 22 January 2012 (CET)
- Great, I will give it a try myself and add a tip at smw.referata.com. Thanks and cheers --[[kgh]] 13:56, 30 January 2012 (CET)
Table cols width
Hi. When displaying an #ask into a table, how do I modify the width for every column? Thanks. Emijrp 15:06, 22 January 2012 (CET)
- Yaron replied this on IRC: You can modify the width using CSS - add it to the page MediaWiki:Common.css Emijrp 01:46, 30 January 2012 (CET)
Missing information in the documentation
Hi, I think that the answer to the first question on this page should be in the documentation. Information that I miss in the documentation:
- what is and what isn't possible in displaying individual values of properties when there are more values of that property.
- use of the option to print a bulleted list, when the ',' works well as a separator (that is if the value itself doesn't contain any comma's).
- what to do when the option above doesn't work or isn't sufficient. (use subobjects instead?)
Thanks! --AdSvS 10:23, 2 April 2012 (CEST)