Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

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

  • vkuzmin
  • vkuzmin's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 6 months ago - 7 years 6 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
Code:
<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
Code:
href="{SURVEYRESOURCESURL}../../../../"
Last edit: 7 years 6 months ago by vkuzmin.
The topic has been locked.
More
6 years 3 months ago - 6 years 3 months ago #161399 by socius
Replied by socius on topic How to get limesurvey base url?
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
Last edit: 6 years 3 months ago by socius.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 3 months ago - 6 years 3 months ago #161434 by tpartner
Replied by tpartner on topic How to get limesurvey base url?
You can try something like this (but I'm not sure whether it will return the absolute or relative path):

Code:
{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: 6 years 3 months ago by tpartner.
The following user(s) said Thank You: socius
The topic has been locked.
More
6 years 3 months ago - 6 years 3 months ago #161597 by socius
Replied by socius on topic How to get limesurvey base url?
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: 6 years 3 months ago by socius.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose