Tags:
create new tag
view all tags

Question

I want to allow users to view files in our source control system via links from the Twiki design docs. For now, I'm happy with just viewing the local copies that every developer should have.

So if I type:

file://c:\sourcetree\ProjectX\src\main.c

I get a link to the local file, and my browser displays it just fine, like any other //file link. But everyone has their local source image in a different place. So I created a variable

Now, I can add the following to a page:

file://c:\sourcetree\projectX\src\main.c

My problem is that on the preview page, this expands correctly to a link, displaying exactly like the link in my first example. But when I save changes, it does not expand the variable, it shows up unexpanded, as

%SOURCETREE%\src\main.c

Why is it different in the preview and the normal view?

Environment

TWiki version: TWikiRelease01Feb2003
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin AliasPlugin EditTablePlugin BeautifierPlugin
Server OS: Windows 2000
Web server: Apache/1.3.28 (Win32)
Perl version: 5.6.1-2 (Cygwin)
Client OS: Windows 2000
Web Browser: Internet Explorer 6.0.2800

-- AdamShelly - 10 Nov 2003

Why closedUnanswered? Twiki is a fantastic tool, you guys have done a great job. I think I have a valid question..

If I set the following variable on my home page:

      * Set %SOURCETREE% = file://c:\sourcetree\projectX

Then why does

   %SOURCETREE%\src\main.c

show up as

   file://c:\sourcetree\projectX\src\main.c

in preview, but

   %SOURCETREE%\src\main.c

after saving?

-- AdamShelly - 05 Mar 2004

Answer

Nothing personal here. If nobody answered a question after a few month time the likelyhood of getting an answer gets smaller and smaller. Those questions get marked as unanswered so that the list in the Support home does not grow longer and longer.

In your case it looks like you use an unsupported case. To define a variable write:

that is, you define the variable without the percent signs. To use it write %SOURCETREE% (e.g. with percent sign) to get file://c:\sourcetree\projectX.

Notice that per topic variables only work in recent TWikiAlphaReleases (as is the case here on TWiki.org)

Preview expands variables twice, this is a bug that has been fixed just now, Codev.PreviewExpandsVariablesTwice.

-- PeterThoeny - 06 Mar 2004

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2004-03-06 - 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.