Topic on Project:Support desk

[RESOLVED] Is it possible to make REVISION*** to show the affected revision instead of the last one?

9
195.234.75.155 (talkcontribs)

For example, I would like to use something like a "citation needed" template. But I would also like to use a human-readable timestamp to indicate when the "citation needed" template (actually just a user-friendly mark) was inserted to the page. Unfortunately REVISIONYEAR, REVISIONMONTH and REVISIONDAY2 show the last change date and time only.

Thanks. (195.234.75.155 11:54, 17 September 2014 (UTC))

Jackmcbarn (talkcontribs)

Put subst: in front of it. For example, use {{subst:REVISIONMONTH}} instead of {{REVISIONMONTH}}. It will then get "baked" into the page when you save it, so it won't change in the future.

195.234.75.155 (talkcontribs)

Thanks, tat's interesting and I'll definitely try it later. Just a question: would it be "baked" if it's rendered using a template so a template could be used a timestamp-mark at a "regular" page?

195.234.75.155 (talkcontribs)

Can't edit the previous message. It should be:

"Thanks, that's interesting (I was not aware of "subst:" at all) and I'll definitely try it later. Just a question: would it be "baked" if it's rendered using a template so the template could be used as a timestamp-mark at a "regular" page?"

Update 1: I've just checked the "subst:" and it does not work for me. It simply renders the "substed" as plain text.

Jackmcbarn (talkcontribs)

Try editing your template to make it look like this:

{{ {{{|safesubst:}}}#if:{{ns:0}}|{{The name of your template|month={{ {{{|subst:}}}REVISIONMONTH}}|year={{ {{{|subst:}}}REVISIONYEAR}}}}|The original content of your template, using the month and year parameters}}

You should be able to adapt that to the exact parameters you require.

194.44.30.5 (talkcontribs)

Thanks for the snippet, but I'm having another issue (if I use your code right after all): does it mean that the template should now accept parameters? The idea of the template was just to place a spot like {{Verify}} without arguments. Not sure if this is possible now...

Jackmcbarn (talkcontribs)

It's possible, sort of. What will happen is that you'll add {{subst:Verify}} to the page, and then when you save it, MediaWiki will turn it into {{Verify|date=September 2014}} automatically.

194.44.30.5 (talkcontribs)

I've just checked it again and finally realized what the subst is for. Basically it does what I want, and yeah, it's really "baked", but unexpectedly it's "baked" directly into the code. I was hoping for something that could simply "remember" a particular revision, but not in this way. Additionally, {{Verify}} is not enough without the subst injection at the page. However, your answer is really awesome. Thank you!

Jackmcbarn (talkcontribs)

Indeed, there's no way to bake it unless you bake it directly into the code. Even on Wikipedia, that's how we do it, such as with w:Template:Citation needed.

Reply to "[RESOLVED] Is it possible to make REVISION*** to show the affected revision instead of the last one?"