- Posts: 4
- Thank you received: 0
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
- Topic Author
- Offline
- New Member
Less
More
8 years 7 months ago #126605
by zetetic
Can I set a default survey if someone enters just the URL of my LimeSurvey site. was created 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?
Is this possible?
The topic has been locked.
- Ben_V
- Offline
- Platinum Member
Less
More
- Posts: 1128
- Thank you received: 329
8 years 7 months ago #126607
by Ben_V
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)
Replied by Ben_V on topic Can I set a default survey if someone enters just the URL of my LimeSurvey site.
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.
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&sid=1234&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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
8 years 7 months ago #126608
by zetetic
Replied by zetetic on topic Can I set a default survey if someone enters just the URL of my LimeSurvey site.
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.
File contents:
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
- Away
- LimeSurvey Community Team
Less
More
- Posts: 11694
- Thank you received: 2750
8 years 7 months ago #126610
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Can I set a default survey if someone enters just the URL of my LimeSurvey site.
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.
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13693
- Thank you received: 2501
8 years 7 months ago - 8 years 7 months ago #126636
by DenisChenu
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.
Replied by DenisChenu on topic Can I set a default survey if someone enters just the URL of my LimeSurvey site.
I use this in surveylist.pstpl
But i think you can try to use your own controller for this too.
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>
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.
- Ben_V
- Offline
- Platinum Member
Less
More
- Posts: 1128
- Thank you received: 329
8 years 7 months ago #126646
by Ben_V
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)
Replied by Ben_V on topic Can I set a default survey if someone enters just the URL of my LimeSurvey site.
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.
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
- Away
- LimeSurvey Community Team
Less
More
- Posts: 11694
- Thank you received: 2750
8 years 7 months ago #126685
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Can I set a default survey if someone enters just the URL of my LimeSurvey site.
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.