Gebruiker:Pjetter/klad: verschil tussen versies

Verwijderde inhoud Toegevoegde inhoud
Pjetter (overleg | bijdragen)
werkt
Pjetter (overleg | bijdragen)
+log (met toestemming overgenomen)
Regel 1:
<pre>
<Londenp> Hi. Question for someone who knows the Parser functions: Is there a way how I can find out with parser language if a certain article is in a category. Something like if AAA is in CAT:BBB then display a certain image?
<Splarka> probably need DPL for that (depending on what you wanna do exactly)
<Londenp> In fact it is for Wikibooks
<Londenp> We have categorized the books in fases 0 to 4
<Splarka> or in JS or CSS
<Londenp> I would like to show on the front page a bookname together with a symbol for the development states
<Londenp> I couldn't find a solution with magic words and a parser
<Splarka> Londenp: well, what categorizes it? a template? or the [[category]] added directly?
<Londenp> with a template
<Splarka> so, like {{devstate|3}} ?
<Splarka> you can use the template to categorize, and generate the image
<Splarka> say you had {{devstate|3}} for example
<Splarka> [[Category:Development state {{{1|0}}}]]
<Splarka> {{#switch:{{{1|none}}}
<Londenp> OK
<Duesentrieb> Splarka: but he wants the image not on the page that is categorized, but on a pages that links to the page that is categorized
<Splarka> |0=[[Image:Devstate_0.png|40px]]
<Splarka> |1=[[Image:Devstate_1.png|40px]]
<Splarka> etc
<Splarka> really? hmmmm'
<Londenp> Duesentrieb exactly
<Splarka> DPL or javascript
<Duesentrieb> don't know if something like that exists.in any case, it would be tricky with parser cache
<Splarka> javascript could do it in a quick query to the API
<Londenp> We have Dynamicpagelist installed
<Duesentrieb> disabling it is the obvious solution, that would suck for the front page though
<Splarka> (but on the front page that would be messy)
<Splarka> DPL should be able to do it then
<Londenp> not DPL alas
<Splarka> which wikibooks?
<Londenp> nl
<Londenp> Rereading the remark from Duesentrieb it is still a little different
<Splarka> useful how it doesn't say what version of dpl it has
* Splarka grumbles
<Londenp> it is the old old one
<Londenp> http://www.mediawiki.org/wiki/Extension:DynamicPageList/old This one
<Splarka> drat, don't think you can do what you want with it then
<Londenp> That is what I thought
<Londenp> It is very useful though, but the most modern version of DPL is much better
<Londenp> but I was not allowed to let that be installed on nl.wikibooks.org
<Londenp> might try again thoug on bugzilla
<Londenp> So my idea is this {{template|bookname}} for each book
<Londenp> this will show a link to the book and display a image for the status of development of this book
<Londenp> this will automatically be updated if the status is changed
<Splarka> only way I can think of is the API, but on the mainpage that would be a lot of queries to it (and it isn't cached)
<Splarka> or a custom extension
<Londenp> The information for the status of the book is with a DPL-thing in a hidden category and the template would look in which hidden category for the status it is and then display the according image
<Londenp> OK too bad then
<Splarka> OR.. you could create subpages for each book, that indicate the status
<Splarka> such as {{Somebook/status 1}}
<Splarka> and use #ifexist
<Splarka> but that'd be... messy
<Londenp> That is a good idea
<Londenp> Sparkla Thanks I will try that then
<Splarka> uhoh
<Splarka> don't you hate it when someone is threatening to jump off a bridge, and you say "go for it" sarcastically.. and then they do...
<Splarka> Londenp: you could also create one subpage, like [[Bookname/status]]
<Londenp> You might give me another choice :-=)
<Splarka> and have that /status contain the image that you want to transclude
<Splarka> and then always transclude [[{{{1}}}/status]] if it exists
<Splarka> that way you don't have to create and delete pages continually
<Londenp> yep
<Splarka> {{#ifexist:{{{1}}}/status|{{{{{1}}}/status}}|[[Image:Nostatus.gif]]}}
<Londenp> In fact we have something like an Infobox with the book that contains all information already
* Splarka nods
<Londenp> I just don't know how to substract that
<Splarka> heh
<Splarka> well, then...
<Splarka> what if /status only contained the number
<Splarka> 0 to 4
<Splarka> and on the infobox:
<Splarka> [[Category:Development status {{{{{FULLPAGENAME}}/status}}]]
<Splarka> and on the main page:
<Splarka> {{#ifexist:{{{1}}}/status|[[Image:Status_{{{{{1}}}/status}}.gif]]|[[Image:Nostatus.gif]]}}
<Splarka> then you just update that /status page, and both the main page and the infobox are changed
<Londenp> OK, looks good
<Londenp> but I need a little time to understand this (not being educated)
* Splarka nods
<Londenp> Sparkla thanks, I am going to study your proposals and work it out. When I have some more questions I will return.
<Splarka> thanks for the warning ^_^
</pre>
 
 
<pre>
test 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890
Informatie afkomstig van https://nl.wikibooks.org Wikibooks NL.
Wikibooks NL is onderdeel van de wikimediafoundation.