Relative or Aboslute

Jun 22, 2015 at 7:51 PM

For hyperlink fields, is there a way to enforce relative paths for links? Seems to be absolute and I don't see an option to change that, but maybe I am missing something. If there is not, I may have to DB script a find and replace. Which table(s) would I do that on?
Jun 23, 2015 at 7:03 AM
Are you sure you want absolute links? because then the link to the image would be different on every page you're on - which is quite a dangerous trick to try.

Or is it the domain that you have and don't want, but still absolute?
Dec 11, 2015 at 4:20 PM
Hi -

I wanted to follow up on this again because I just went through the same issue when moving a site from a dev server to production. I don't think you understood my original question. All the hyperlink controls had absolute paths/urls outputted to the templates.

I had to run a script to update the table and remove the domain from the path:

declare @FIND as nvarchar(MAX)
declare @REPLACE as nvarchar(MAX)
set @FIND = ''
set @REPLACE = '/'
update ToSIC_EAV_Values set Value = cast(replace(cast(Value as nvarchar(max)),@FIND, @REPLACE) as ntext)

This is using the last version of 7, so you should test 8 and verify if this is an issue.
Dec 21, 2015 at 5:02 PM
Any comment to this?
Dec 23, 2015 at 8:32 AM
A hyperlink field should save just the number when referencing to a file or page. While rendering, the template will get the full (absolute) URL.

Is your problem occurring when linking to files, or pages?