Question
Hello, i'd like to add the currently valid timestamp to the signature-filed containing the "Your signature for easy copy and paste:" whenever i edit a topic.
I didn't found yet where to do that (the search function didn't bring any interesting thing up to me so maybe i used it wrong if this has already been discussen/adressed), so it would be really nice if you have some advises.
Cheers and thanks in advance,
Benjamin
--
BenjaminBachmann - 01 Oct 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
That text is defined in
templates/edit.pattern.tmpl (assuming you are using the default skin). If you shun the quick'n'dirty approach of simply overwriting this file because of the extra work it creates with every upgrade, check out
TWiki.PatternSkinCustomization#First_Read_How_to_modify_Pattern for guidelines how to customize without fiddling with the internals.
--
HaraldJoerg - 01 Oct 2007
Hello Harald,
thanks for your answer, but i have another question regarding this: Isn't it possible to have different "signatures" for different users? We have a really big TWiki here and i'm not sure if there won't be any problem changing things in the template, i have recently joined the team here and i don't know yet (cuz i'm lacking full admin-rights atm) if we use a slightly modified skin.
--
BenjaminBachmann - 02 Oct 2007
Individual signatures are possible, but much easier with some support in the templates.
The user specific part would be done by specifying their signature in their individual user topics (like
BenjaminBachmann in your case) a preference variable like e.g.
%SIGNATURE%, and a default for this variable could be defined in
Main.TWikiPreferences. You would still need to
use this preference variable in the template, though, instead of the current fixed value of
%WIKIWEBNAME% - %DATE%.
Without changing the template you could make use of the fact that you can
override TWiki's variables by your own preference variables, at your own risk. So you could redefine
%DATE% in your home topic to be something like
%DISPLAYTIME%. Unfortunately that would affect
all occurrences of
%DATE%, not only in your signatures. So you could use
IfStatements to only show the time in edit screens. Finally, take great care not to re-define
%DATE% in terms of
%DATE% itself because that would get you into an endless (not really endless, but annoyingly long) loop.
So, if you are as hackish as I am, you could enter the following line to your home topic:
* Set DATE = %IF{"context edit" then="%DISPLAYTIME%" else="%DISPLAYTIME{"$year-$mo-$day"}%"}%
Just hit "edit" for
this topic and you should see the effect: By writing the line here, I've made it a
topic preference variable, which is evaluated even when it's in a verbatim block!
--
HaraldJoerg - 02 Oct 2007
Wow, Thank you Harald.
I'm sorry, i was ill and hadn't the chance to look here. That's exactly what i needed!
--
BenjaminBachmann - 2026-01-28
Ahh... i mentioned one thing: The IF-else seems not to work :/ But anyways... you helped me a lot. If I edit something i get this as signature: --
BenjaminBachmann - %IF{
Don't know whats the bug, have to get in touch with the main admin... but he's still in vacation
--
BenjaminBachmann - 2026-01-28
Since it works at this site: Please double check and double double check the syntax. Or could it be that your TWiki is too old to understand
context? What's your version? You should find it at your TWiki.WebHome!
--
HaraldJoerg - 2026-01-28
Hello Harald,
i guess it's an to outdated version, here is the text it shows:
This site is running TWiki version 02 Sep 2004 $Rev: 1742 $, Plugin API version 1.025
--
BenjaminBachmann - 2026-01-28
Tough luck, then: That's the signature of TWiki version 3, also known as
CairoRelease. Your version doesn't know about
IF{...}, according to
TWiki03.TWikiVariables. One reason more to talk to your admin to upgrade
--
HaraldJoerg - 2026-01-28
all right, gonna talk to him then if he comes back from vacation,
thanks a lot for your help!
--
BenjaminBachmann - 2026-01-28
Closing, question seems to be answered.
--
PeterThoeny - 2026-01-28