Difference between revisions of "BattleTechWiki talk:SemanticMediaWiki"

m
Line 34: Line 34:
 
I'll explain line by line how this works:
 
I'll explain line by line how this works:
  
This line tells the table what the overall topic will be. In this case this table will cover all pages that appear under the <nowiki>[[Category:BattleMechs]]</nowiki> category page. Other examples include <nowiki>[[Category:Assault BattleMechs]]</nowiki> or [[Category:Combat Vehicles]]. Additionally, you can try to limit results that are covered in two categories. For example, if you only wanted a table about Clan OmniMechs, then you would add two category tags to the #ask: line, <nowiki>[[Category:OmniMechs]]</nowiki> and <nowiki>[[Category:Clan General Battlemechs]]</nowiki>.
+
This line tells the table what the overall topic will be. In this case this table will cover all pages that appear under the <nowiki>[[Category:BattleMechs]]</nowiki> category page. Other examples include <nowiki>[[Category:Assault BattleMechs]]</nowiki> or <nowiki>[[Category:Combat Vehicles]]</nowiki>. Additionally, you can try to limit results that are covered in two categories. For example, if you only wanted a table about Clan OmniMechs, then you would add two category tags to the #ask: line, <nowiki>[[Category:OmniMechs]]</nowiki> and <nowiki>[[Category:Clan General Battlemechs]]</nowiki>.
 
  <nowiki>{{#ask:[[Category:BattleMechs]]</nowiki>
 
  <nowiki>{{#ask:[[Category:BattleMechs]]</nowiki>
  

Revision as of 01:41, 16 February 2012

A lot of questions

Hy Revanche, greate to create this page for us, i make my first steps with the SemanticMediaWiki, but i have some questions, i talk to Seth and he fix some little thinks, but when i see the BattleMech Timetable created by himself, i have one critical view, we have the table and the 'Mech infobox is updated by the code, but not one link bring me directly to the Mech Timetable page, ok the tagged introduction, reintroced, ect. links bring my only to the year pages this is very good, but no link to BattleMech Timetable that use the semantic code there included today by Seth, i know the semantic is new, but i want to help to fix little thinks what i see or not see ;), this is not a critic but a point of view by myself, i think you know what i mean, greeting.--Doneve 16:13, 15 February 2012 (PST)

Ok, I fixed it so that all the years listed in the infobox will send people to the timetable page instead of the year page. They can still go to the year page by clicking the years on the time table.--Seth 19:40, 15 February 2012 (PST)

Column size

Seth, is there a way to restrict the column width? For example, the BM Timetable fills up the screen unnecessarily. How may that be adjusted?--Revanche (talk|contribs) 20:13, 15 February 2012 (PST)

Ok, I changed the format from "broadtable" to just "table". --Seth 20:33, 15 February 2012 (PST)

How to create a new results table

I'll try to explain how to create your own Semantic results table. If we take a look at one that's being used on the BattleMech Timetable:

{{#ask:[[Category:BattleMechs]]
|?Production Year
|?Extinction Era
|?Reintroduction Year
|format=table
|mainlabel=BattleMech Timetable
|offset=0
|limit=10
}}

That results in this:

BattleMech TimetableProduction YearExtinction EraReintroduction Year
Adder (Puma)3010
Agrotera3108
Akuma3058
Albatross3053
Alliance (BattleMech)
Alpha Wolf3150
Amarok3149
AmbassadorSecond Succession War3025
Anastasia (FrankenMech)3138
Annihilator3048
... further results

I'll explain line by line how this works:

This line tells the table what the overall topic will be. In this case this table will cover all pages that appear under the [[Category:BattleMechs]] category page. Other examples include [[Category:Assault BattleMechs]] or [[Category:Combat Vehicles]]. Additionally, you can try to limit results that are covered in two categories. For example, if you only wanted a table about Clan OmniMechs, then you would add two category tags to the #ask: line, [[Category:OmniMechs]] and [[Category:Clan General Battlemechs]].

{{#ask:[[Category:BattleMechs]]

These three lines tell the table what specific properties it is looking for on the pages is the above category (categories). To add properties to a new page, use this tag [[property name::property]], in this case I used [[Production Year::3010]] for the Adder page.

|?Production Year
|?Extinction Era
|?Reintroduction Year

By default the results are displayed in alphabetical order of the page names in the left column, but it is possible to sort the table by using one of the following properties. To sort the table by production year, add these two lines:

|sort=Production Year
|order=descending (or ascending)

To display your results in a table, you would use either |format=table or |format=broadtable for a full page width table.

|format=table

This is the main label of the table.

|mainlabel=BattleMech Timetable

Generally, you would leave this at 0. If you set it to 5 for example, it would skip the first 5 results.

|offset=0

This determines how many results you want to show at any given time. I set it to 10 to keep this example manageable, but you can display up to 500 at a time.

|limit=10

And this closes your table.

}}