Welcome to the LimeSurvey Community Forum

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

Can I set a default survey if someone enters just the URL of my LimeSurvey site.

  • zetetic
  • zetetic's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 7 months ago #126605 by zetetic
I want users to be redirected to the one survey I have in case they they go to the main URL that hosts my Lime Survey install (e.g. survey.domain.com) in case they don't enter the unique survey URL.

Is this possible?
The topic has been locked.
More
8 years 7 months ago #126607 by Ben_V
Hi ,
In the surveylist.pstpl file of the default template of your install (the most of the time "default" theme) just set a redirection (meta refresh or javascript) pointing to your survey.
Code:
<meta http-equiv="refresh" content="0;url=index.php?r=survey/index&amp;sid=1234&amp;newtest=Y">

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The following user(s) said Thank You: zetetic
The topic has been locked.
  • zetetic
  • zetetic's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 7 months ago #126608 by zetetic
Ben_V


I edited the file in the template I'm using (verified this on the Global Settings / General panel)

root directory / survey / templates / tfr_responsive / surveylist.psptl

I inserted this at the top of the file, and then at other places throughout the file (file contents below) but no luck. I still get to the page that lists the available surveys.
Code:
<META http-equiv="refresh" content="5;URL=http://survey.domain.com/index.php/survey/index/sid/297725/newtest/Y/lang/en">

File contents:
Code:
<META http-equiv="refresh" content="5;URL=http://survey.domain.com/index.php/survey/index/sid/297725/newtest/Y/lang/en">
 
<div class="jumbotron survey-list-table">
  <h1 class="site-name">{SITENAME}</h1>
  <p>{SURVEYLISTHEADING}</p>
  <p>
    <ul>{SURVEYLIST}</ul>
  </p>
  <p class="text-muted survey-contact">{SURVEYCONTACT}</p>
</div>
The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 7 months ago #126610 by holch
I think you can't insert a meta tag in the surveylist.pstpl because it should be in the header of the page, which is probably in another file of the template. However, if you include the meta refresh function, in the header of the template, it will redirect on any page of the survey. So this won't work.

How about using .htacces to recirect the base URL to the questionnaire?

What I usually do is install Limesurvey in a sub directory of the Domain anyway. Then you could create a index.html in the route document and display the survey directly in an iframe.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 7 months ago - 8 years 7 months ago #126636 by DenisChenu
I use this in surveylist.pstpl
Code:
<p>Goes to <a href="http://example.org/1234?newtest=Y' class='redirect'>the survey </a></p>
<script type="text/javascript">
window.location.replace("http://example.org/1234?newtest=Y");
</script>
But i think you can try to use your own controller for this too.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 8 years 7 months ago by DenisChenu.
The following user(s) said Thank You: Ben_V
The topic has been locked.
More
8 years 7 months ago #126646 by Ben_V
Hi Holch,
Using meta-refresh inside the body element is of course invalid for HTML4.01… but actually the trick do the job even with a javaScript-incapable browser. Obviously for a webpage requiring javascript, it's better to use some js redirection.

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The following user(s) said Thank You: holch
The topic has been locked.
  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 7 months ago #126685 by holch
Thanks Ben! I didn't test it. I just guessed that this could be the problem, as the surveylist file obviously doesn't contain the head tag. But good to know that it would/should work anyway. But websites without Javascript is very rare today, I guess.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose