Both sides previous revision Previous revision Next revision | Previous revision |
wiki:tag_plugin [2023/02/18 06:44] – removed - external edit (Unknown date) 127.0.0.1 | wiki:tag_plugin [2023/02/18 15:47] (current) – ↷ Links adapted because of a move operation suedunham |
---|
| ====== Tag plugin ====== |
| |
| [[doku>plugin:tag|Tag plugin page]] |
| |
| This is a way of grouping pages along several different relationships and then generating lists of those related pages. For instance, [[works:harn:kaldor:kiban]], is tagged with its publisher, region, realm, as a castle, and under its own name. |
| |
| This provides two useful features. The wiki user can click on any of those tags to see pages listing other works by [[works:publishers:cgi]], others set in Hârn and in Kaldor, other castles, and—since a few other works detail additional information in and around the place—more about Kiban itself. |
| |
| The second use is on the page collecting [[works:harn:kaldor:|all works pertaining to Kaldor]], and other pages like it. Each section of that page has a list, or "topic", generated by the plugin that groups pages with the appropriate combination of tags. New pages added to the wiki then appear in all the correct lists automatically without further maintenance from editors. |
| |
| That latter function is similar to what the [[nspages_plugin]] can do but comes at it from a different angle. It can be used within or without namespaces as needed. |
| |
| ===== Basic use ===== |
| |
| Those two uses look like this. |
| |
| ==== Tagging pages ==== |
| |
| When a new page is created in the ''works:'' section, a page template will provide the start of a line of tags just under the page heading that looks like this. |
| |
| <code> |
| {{tag>cgi ldc works:some_tag}} FIXME |
| </code> |
| |
| This is edited as needed. The first two are different publishers, Columbia Games and [[works:publishers:ldc|Lýthia Dot Com]]. One of those should be removed, both if a different tag—like ''kpl'' for [[works:publishers:kpl]]—is needed instead. |
| |
| The next tag, ''works:some_tag'', shows the general form of tags in this section. The ''works:'' part is the **tag** namespace used for all tags about pages in the ''works:'' **page** namespace. Those are two different kinds of namespaces. The tags one doesn't have any sub-namespaces like the pages one does. |
| |
| That namespace is added for ''works:'' pages to allow for different tags to be usable in the [[:harn:]] and other "World" sections of the wiki. However, it has not yet been determined just how those will be set up. It is enough for now to ensure that page lists of ''works:kaldor'' tags won't have pages with ''kaldor'' tags mixed in. |
| |
| The ''%%FIXME%%'' just prints a reminder to editors that there is something to be edited here. It should be removed when the line is adjusted to look something along the lines of Kiban's: |
| |
| <code> |
| {{tag>cgi works:harn works:kaldor works:castle works:kiban}} |
| </code> |
| |
| ==== Listing tagged pages ==== |
| |
| The other aspect is generating the lists with ''topic'' statements. The Kaldor works page is probably a bad example, since the sheer mass of materials led to finer distinctions made there than elsewhere. But we'll run with it. |
| |
| On the Canon tab of the page, the principal works are those regarding the kingdom, or "realm", itself and the holds within. These are made with two different ''topic'' statements in order to place the big ones at the top. |
| |
| <code> |
| ===== Realm and holds canon ===== |
| {{topic>.?works:realm works:overview works:city +cgi&simplelist}} |
| {{topic>.?cgi kpl -works:realm -works:overview -works:city -works:location -works:harnic_lore&simplelist}} |
| </code> |
| |
| They start with the enclosing brackets and ''topic>''. The next part, ''.?'' constrains the search to the current page namespace, in this case ''works:harn:kaldor:''. It can be omitted in order to search everywhere. |
| |
| Following that is a list of the tags for the pages desired. In the first topic, the block of ''works:realm works:overview works:city'' gets pages with any one (or more) of those tags. The last tag, ''cgi'', is preceded by a plus sign which works as a logical ''and''. So pages with ''cgi works:realm'' or ''cgi works:overview'' or ''cgi works:city'' are returned. |
| |
| The last term, ''&simplelist'' tells the plugin how to style the output. The present editor has found that it needs to come immediately after the last tag without a space in order to work. |
| |
| For the second topic, the logic is reversed. The two canon publishers, ''cgi'' and ''kpl'' form the ''or'' grouping. then, the tags from the first topic are excluded with a minus sign, ''-'', so they don't appear in both lists. Next come two other tags that we wish to list separately elsewhere on the page. |
| |
| There aren't any ways to group logical blocks, as with parentheses, so some trial and error is required find just what works. It is going to be a headache in that first topic should Keléstia get into the Kaldor business. Their tag isn't strictly needed in the second—yet—but is included for future-proofing. |
| |
| Further down the Canon tab are the sections of related works. They each search within the appropriate page namespace, so instead of leading with ''.?'', they have ''works:adventures?'' and the like. |
| |
| <code> |
| ===== Related canon ===== |
| |
| ==== Adventures canon ==== |
| {{topic>works:adventures?cgi kpl -works:adventure_seed +works:kaldor&simplelist}} |
| |
| ==== Atlas Hârnica canon ==== |
| {{topic>works:atlas_harnica?cgi kpl +works:kaldor&simplelist}} |
| |
| ==== Religion canon ==== |
| {{topic>works:religion?cgi kpl +works:kaldor&simplelist}} |
| |
| ==== Wilderness canon ==== |
| {{topic>works:wilderness?cgi kpl +works:kaldor -works:trade&simplelist}} |
| |
| === Trade Routes canon === |
| {{topic>works:wilderness?cgi kpl +works:kaldor +works:trade&simplelist}} |
| </code> |
| |
| On the Fanon tab, the logic works a little differently. The General Fanon topic is ''works:kaldor'' and a whole lot of ''not'', including both canon publishers. |
| |
| <code> |
| ===== General fanon ===== |
| {{topic>.?works:kaldor -works:series -works:tashal -works:city -works:castle -works:keep -works:manor -works:abbey -works:ruin -works:location -works:map -works:data -works:kaldor_port -works:succession -cgi -kpl&simplelist}} |
| </code> |
| |
| Rather than a topic for all fanon holds, Kaldor has one for the major settlements and lists the minor ones elsewhere. |
| |
| <code> |
| ===== Castles & keeps fanon ===== |
| {{topic>.?works:castle works:keep -works:map -works:location -cgi -kpl&simplelist}} |
| </code> |
| |
| In other realms, there are usually, ''works:city works:manor works:abbey'' joining the big ''or'' with the castles and keeps. |
| |
| Maps and locations are generally given under their own headings. There is material extant about locations in Kiban, which is why that tag was created. |
| |
| <code> |
| ===== Locations fanon ===== |
| |
| ... |
| |
| === Kiban === |
| {{topic>works:kiban +works:location -cgi -kpl&simplelist}} |
| </code> |
| |
| ===== Tags and conventions ===== |
| |
| Frankly, the tags have proliferated over time like weeds and the reasoning behind them may have drifted. A listing of every tag present in the wiki [[tags|can be found here]], and the number of them makes the search capability there a bit unwieldy. |
| |
| Still, there should be some guidance regarding which tags to use where. Someone should get on that. [[tag_conventions]] |
| |
| ===== Related plugins ===== |
| |
| One plugin, [[pagelist_plugin|Pagelist]], is required for Tag to work. This actually forms the pages of lists to which each tag links. Some of its flags can be used from within Tag. |
| |
| The [[searchindex_manager_plugin]] is an Admin utility that isn't required but can come in handy. If, for instance, several wiki pages are moved around in one mass action, the index upon which Tag relies can lag behind those changes. This can rebuild the index from the current state of the wiki. |
| |