How to get limesurvey base url? like http://example.com/limesurvey/

More
2 years 5 months ago - 2 years 5 months ago #141548 by vkuzmin
I'm use "/limesurvey/" in links but its not so good. For example, when i want to show a link to start survey again i'l type
<a href="/limesurvey/index.php/survey/index/sid/{SID}/newtest/Y/lang/en">Start again</a>
Is there any replacement for base url? To do something like {BASEURL}/index.php/survey/index/sid/{SID}/newest/Y/lang/en

Closest one i've found in replacements_helper.php is
href="{SURVEYRESOURCESURL}../../../../"
Last edit: 2 years 5 months ago by vkuzmin.

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago - 1 year 2 months ago #161399 by socius
Hi all,

@vkuzmin, did you finally find a solution to this, i.e. a placeholder that returns the base url?

I would like to use the base url in a survey question (not in the mails). I use LS Version 2.6.4.

I just searched the documentation ( manual.limesurvey.org/URL_fields , manual.limesurvey.org/Email_templates , ) and the forum and did not find a solution.

{SURVEYRESOURCESURL} gives back the correct URL for .../upload/surveys/241618
{TEMPLATEURL} gives back the correct URL to the template, but

neither entering
{SURVEYURL} nor
@@SURVEYURL@@

in the question text gave back the link, just errors







Did I overlook anything?

Thanks a lot for any hint!

Best,
G
Attachments:
Last edit: 1 year 2 months ago by socius.

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago - 1 year 2 months ago #161434 by tpartner
You can try something like this (but I'm not sure whether it will return the absolute or relative path):

{if(stripos(TEMPLATEURL, '/upload/templates/'), substr(TEMPLATEURL, 0, stripos(TEMPLATEURL, '/upload/templates/')+1), substr(TEMPLATEURL, 0, stripos(TEMPLATEURL, '/templates/')+1))}

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 1 year 2 months ago by tpartner.
The following user(s) said Thank You: socius

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago - 1 year 2 months ago #161597 by socius
Thanks @tpartner! (and sorry for my late response!)

This works!

I have my webspace at my university, in the form
www.university.edu/mywebspace/lsinstallationdir

and in my case this code returns the relative path:
/mywebspace/lsinstallationdir

Thanks!
Best
G
Last edit: 1 year 2 months ago by socius.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!