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
--
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