custom URL strings for a field

LabKey Support Forum (Inactive)
custom URL strings for a field Ben Bimber  2010-06-23 09:45
Status: Closed
 
In lists you can define a custom URL for a field. there is a max character length on the URL string. when you have many nested folders, the URL rapidly becomes too long. i tried these two things to workaround it:

1. I tried to make a relative URL (ie. ../otherFolder/list.view...), but this URL failed b/c of a bad format string (i think it expects 'http'). perhaps there is a different way to write relative URLs i'm not aware of.

2. normally i'd write a URL in labkey like: href="<%=contextPath%>/query<%=containerPath%>/executeQuery.view. b/c the full container path gets reduced in size, this gets rids of the URL length problem. however, this fails URL validation (no http) and also gives an invalid character error.

I ended up aliasing the folder in question to reduce URL length. Is there a better solution?

thanks in advance.
 
 
Matthew Bellew responded:  2010-06-23 10:01
We currently support two URL formats

1) absolute
   must start with http: or https:

2) controller/action
   like a labkey url without the path, the path of the current container will be filled in
   e.g. /project/begin.view

It seems we have a problem that needs to be fixed as far as length. But for now, one way to shorten the URL is to use the container id or container rowid instead of the path in the url e.g.

https://www.labkey.org/project/79704b7a-b9ab-e733-0002-0106c1fdd116/begin.view
or
https://www.labkey.org/project/__r2/begin.view?

There are two ways to figure out this shorter link. The easiest is to click the "Permanent Link" in the navigation area on the left. The other is to go to admin/<path>/containerId.view e.g. https://www.labkey.org/admin/home/containerId.view to see the containerId and rowid.

Matt