create new tag
, view all tags


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


ALERT! 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 - 2018-04-27

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 - 2018-04-27

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 - 2018-04-27

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 - 2018-04-27

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 - 2018-04-27

all right, gonna talk to him then if he comes back from vacation, thanks a lot for your help!

-- BenjaminBachmann - 2018-04-27

Closing, question seems to be answered.

-- PeterThoeny - 2018-04-27

Change status to:
Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r11 - 2007-12-03 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.