User talk:FeRDNYC/Template Sandbox

From GodWiki
< User talk:FeRDNYC
Revision as of 20:37, 21 December 2018 by FeRDNYC (talk | contribs) (→‎Nested subst?: correct)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Nested subst?

My experience with using subst is close to zero, so this is a question for your experience and expertise.

The reasoning behind the draft hatnotes (which I haven't completely convinced myself about yet) for JanuWiki is to try to minimise edit collisions. Just like the use case with the normal {{construction}}, but also to bring forward onto the hatnote some information that is normally buried into the History page, hopefully minimising the chance of stepped-on toes or etiquette issues between folks who may both have wanted to create an article. It can also give the volunteer editors some helpful guidance — if a JanuWiki page is incomplete and hasn't been touched in a while, perhaps the author needs some pro-active support or advice, or would like to relinquish it to another creator. Et cetera.

So, to those ends, I had considered that an {{{author}}} parameter would be a good signal (with some links to contact points for ease, salient ref: because contacting people directly on MediaWiki is a CHORE 😊). To that end, I simply don't know if it's possible to nest a {{subst:REVISIONUSER}} into the template. The wording at MediaWiki:Help:Magic_words#Transclusion_modifiers says: "In the wikitext, the tag is substituted by the content (single-level evaluation only)" would seem to imply that what I am imagining is possible, but I don't understand subst: or safesubst: well enough... Is what I'm imagining possible? Or is it even necessary, am I barking up the wrong tree? -- Djonni (talk) 15:39, 21 December 2018 (UTC)

I'm highly inexpert in how all of that works, but I don't think such things are possible by nesting subst magic words. (Actually, I'm pretty sure that's exactly what safesubst is for, I just have no idea how safesubst works, and my attempts to use it usually led me to figuring out a different approach rather than figuring out safesubst To wit:) However, I'm also not sure it's necessary in this particular case, fortunately — if I'm following, that is.
If you want to embed the username of the editor who's performing a save action into the article they're editing, the easiest way is the three-tildes trick. If we're talking about pre-filling content, it's easy enough to pre-fill in that string, and it'll be effectively-subst-ed on save.
With the edit-link prefilling trick it would actually be possible to pre-fill {{subst:}} strings when preloading an edit window, too, because the preloading for edit forms isn't done using subst. The preloaded form takes parameters in the URL query string, and replaces $1, $2, etc. references in the preload with those query parameters. So, anything we want can be filled into those, including the text {{subst:REVISIONUSER}}. It's just that, for that case, I don't even think that's necessary because preloading ~~~ is even simpler. -- FeRDNYC (talk) 20:09, 21 December 2018 (UTC)
Actually, when it comes to answering your original question, come to think of it I remember a whole MediaWiki help page on nested substs. It's ancient and in my testing things didn't actually work quite the way it details, but... Yeah, this section (and actually the whole of Help:Substitution) is all about crazy subst tricks. And a lot of it is pre-broken for extra "usefulness". -- FeRDNYC (talk) 20:31, 21 December 2018 (UTC)


I had NO idea those kinds of tricks were possible! THIS CHANGES EVERYTHING.

This makes me rethink that it might be worth making a (collapsible) table of creation links at JanuWiki 2019. Once an article has been created, an editor can remove the line, or replace it with an author's name, or something.

That might not even be strictly necessary, actually. I still have to test more, but I'm pretty sure that if you click a customized, pre-filled link for a page that does already exist, you just get the normal edit window for that page. (IOW, it just ignores the preload.) So, "create" links don't become bad once they're used, they just turn into regular edit links. (I believe.)
Now, for marking-of-territory type concerns people may want to take items off of lists, but that's a separate issue entirely. Point is I don't believe there's any need.

Could we have {{Navbox JanuWiki 2019}} at the bottom, for event pages?

Definitely! If we make the navbox area a parameter of the URLs, we could even stuff in the other navboxes that'd normally go onto the page. (Like, a create link for a boss monster could include
(that's preloadparams[]={{navbox bosses}}\n{{navbox JanuWiki 2019}} when it's decoded). Depending where that comes in the parameters list, a $2 or whatever in the preload form will drop it right in. -- FeRDNYC (talk) 20:22, 21 December 2018 (UTC)