Template:SMW Category Query
When you want to show a query in category format, use this. You only have to pass the query, and can forget having to remember that the |template is called "Pipe Trick".
Usage[edit]
{{SMW Category Query | <-Query parameters-> }}
You need to replace the <-Query parameters-> part with a set of categories, properties, and a namespace that define which pages you are looking for. These different options are explained below.
Category Queries[edit]
Categories are the simplest thing to use in your query. Adding a category to the query is as simple as adding [[Category:<-Category Name->]] to the query parameters section. You do need to replace the <-Category Name-> part with the actual name of the category. If you wanted a list of all pages that belonged to the Monster and 3.5e categories, you would include those in your query parameters like so:
{{SMW Category Query | [[Category:3.5e]] [[Category:Monster]] }}
Property Queries[edit]
Properties are slightly harder to query for, but only because you need to know the name of the property and the value you are looking for. Adding a property to the query means adding [[<-Property name->::<-Property value->]] to the query parameters section. Again, you need to replace the <- -> bits with the actual names. Also note the "::" in the property, this is what distinguishes a property from a page, and you have to write it like that or your query will fail. If you wanted to restrict our last example to only monsters with the Outsider type, you would include the property like so:
{{SMW Category Query | [[Category:3.5e]] [[Category:Monster]] [[Type::Outsider]] }}
Property queries support wildcard characters, allowing you to find search results that match only a part of your whole property query. Adding these is beyond the scope of this documentation, however. For more information, see the [SMW Help] or request help from an administrator.
Namespace Queries[edit]
Lastly, you can restrict your query to a namespace, like SRD or Canon. If you do not include a namespace in your query, you will search in the main namespace (which is restricted to homebrew material on this wiki). Adding a namespace to a query is easy, you only need to add [[<-Namespace->:+]] to the query parameters. Again, you need to replace the <-Namespace-> part with the actual name of the namespace. If you wanted to restrict our last example to only 3.5e outsider monsters in the SRD, you would include the namespace like so:
{{SMW Category Query | [[Category:3.5e]] [[Category:Monster]] [[Type::Outsider]] [[SRD:+]] }}
Limitations[edit]
You can include no more than 7 items in your query, and more than 1 namespace may cause issues. Within those limits, you can use any combination of categories or properties. As this is a search for objects that satisfy all of the above items, including two items that an item will never satisfy, like [[Category:3.5e]] and [[Category:4e]] will cause your query to return nothing.
Note: This example will not return anything, as we don't actually use the 3.5e category in the SRD namespace. It is written here as an example only.