- Posts: 47
- Karma: 1
- Thank you received: 5
- Forum
- English support forums
- Can I do this with LimeSurvey?
- How to get limesurvey base url? like http://example.com/limesurvey/
How to get limesurvey base url? like http://example.com/limesurvey/
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 typeIs 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
<a href="/limesurvey/index.php/survey/index/sid/{SID}/newtest/Y/lang/en">Start again</a>
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.
1 year 2 months ago - 1 year 2 months ago #161399
by socius
Replied by socius on topic How to get limesurvey base url? like http://example.com/limesurvey/
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
@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: 1 year 2 months ago by socius.
Please Log in or Create an account to join the conversation.
1 year 2 months ago - 1 year 2 months ago #161434
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic How to get limesurvey base url? like http://example.com/limesurvey/
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.
1 year 2 months ago - 1 year 2 months ago #161597
by socius
Replied by socius on topic How to get limesurvey base url? like http://example.com/limesurvey/
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
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.