SID-01679: Modifiable Hyperlink
| Status: |
Answered |
TWiki version: |
4.2.4 |
Perl version: |
|
| Category: |
CategoryAutomation |
Server OS: |
|
Last update: |
12 years ago |
Background
My company uses the following style hyperlinks on an internal network.
The variable part of the hyper link is YYYMMDD. It changes daily (today is 20130410; tomorrow would be 20130411)
Is there a way that I can create a link that automatically updates itself on a daily basis?
Any suggestions are welcomed. If anyone knows how to do this in Java Script, please provide a detailed explanation.
Thanks
--
Alec Stephanov - 2013-04-10
Discussion and Answer
Use
%SERVERTIME{$year$mo$day}%, details in
VarSERVERTIME2.
--
Peter Thoeny - 2013-04-10
Hi Peter,
This works great for current day links, however, some of the links use a prior date. Is there a way to use a variable by adjust it by 1 i.e. $day-1?
I was also wondering is there is a plugin I can use to grab user input and use it with in the link i.e. "Enter date (Format = YYYYMMDD) in this box"
Thanks,
Alec
--
Alec Stephanov - 2013-04-11
To calculate a time in the future or past based on the current date look into
$TIME(),
$TIMEADD() and
$FORMATTIME() of
SpreadSheetPlugin.
On user input, create an HTML form where the form action ends up on the same topic:
<form action="%SCRIPTURLPATH{view}%/%WEB%/%TOPIC%"> ... </form>
Add a text input field or a
date picker input field and a submit button to the form. If you are not familiar with HTML consult HTML documentation.
Use
VarURLPARAM to feed the selected date into the link, such as
%URLPARAM{date}%, assuming the form input field name is
date.
--
Peter Thoeny - 2013-04-11
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.