Tags:
create new tag
view all tags

SID-01679: Modifiable Hyperlink

Status: Answered 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

      Change status to:
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.
SupportForm
Status Answered
Title Modifiable Hyperlink
SupportCategory CategoryAutomation
TWiki version 4.2.4
Server OS

Web server

Perl version

Browser & version FireFox 3.5
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2013-04-11 - 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.