Hi, I'd like to write a template for Wikisource with a code that would check if a book (page "Index:Book") is in the "Category:Finished" (fictional category name), and then change an icon accordingly. Is there a magic word for that? Or any other way to do it?
Topic on Project:Support desk
Not really no (possible to write extension to do that, but no such extension is installed on Wikimedia Wikis at the moment). I suppose DynamicPageList does something kind of close, and might one day be able to do that, but as it stands, cannot.
You could maybe put a book's status in a subpage, (Aka Index:Book/status is a page containing just Finished or whatever ) and then use templates to get the value of that and do stuff based on that (possibly including detemining Index:Book's category based on the content of the subpage).
Thanks for the advice, Bawolff. I found this template on the italian wikisource that does what I wanted. However I'll have to read the code a couple of times because I still don't fully understand the procedure it uses.
Extension:PageInCat, no?
Not yet, but that would probably make a good feature for that extension.
(Basically PageInCat can only detect if the current page is in a category. It can't detect if an arbitrary page is in some category)
However, even if PageInCat did support Micru's request, the extension is not installed on Wikimedia, so can't be used on wikisource.