relative URLs / contextPath in wikis

LabKey Support Forum (Inactive)
relative URLs / contextPath in wikis Ben Bimber  2011-03-22 09:02
Status: Closed
 
in HTML pages, labkey allows substitutions like <%=contextPath%> to permit relative URLs. does something similar exist for wiki pages? I did not see anything here:

https://www.labkey.org/wiki/home/Documentation/page.view?name=moreWikiSyntax

I tried to edit the source of the wiki page, and inserted <%=contextPath%>, but that gives an error. If there is no substitution, how does one generally write relative URLs in wikis? the links in question are not to other wiki pages (which have a special syntax). examples would include:

1. linking to executeQuery.view to show a table
2. linking to an HTML page defined in a module
3. could apply to pretty much any other labkey page.

thanks in advance.
 
 
jeckels responded:  2011-03-22 11:03
Hi Ben,

I don't think we have a syntax in Wikis to insert the context path. Typically, when authoring wiki pages we use URLs that are relative to the server, but not the current page or folder ("/announcements/home/Developer/Forum/begin.view?", for example).

If you're changing servers or context paths, we have a small webapp that can be deployed at the old location that redirects browsers to the new location. You can use access logging to help track down links that need to be updated. Let us know if you're interested.

Thanks,
Josh
 
Ben Bimber responded:  2011-03-22 11:12
hi josh,

i would be interested in the redirection webapp.

our old server had /labkey as the context path. that was a constant pain when trying to make relative URLs. the new server is going to run labkey as the root webapp, which will make relative URLs much easier. i think your example only really works when the contextPath is null (like your example). if the baseUrl of labkey.org was: https://www.labkey.org/labkey/ then making relative URLs is problematic.

i just through I would check on the wiki syntax. I'm going to be asking some of our wiki authors to check their pages for links. It sounds like they wont actually be able to make changes until we migrate to the new server though.