Check out the LimeSurvey source code on GitHub!

How do you change the text for the page that checks for valid token?

More
5 years 7 months ago #61895 by PDATechSupport
Hi-

How do I modify the language for web page that is displayed that says "This is a controlled survey. You need a valid token to participate..." or that the token is valid but not able to access the survey because it has expired.

I looked through all of the template windows but couldn't find it.

Thanks!

Please Log in to join the conversation.

More
5 years 7 months ago - 5 years 7 months ago #61953 by greg_d
You can 'change' the language by setting lang parameter value in URL.
For example
demo.limesurvey.org/index.php?sid=52388&newtest=Y&lang=en
can be changed to
demo.limesurvey.org/index.php?sid=52388&newtest=Y&lang=de
for german message.

If you want to change the text for a given language you have to modify the translation: docs.limesurvey.org/tiki-index.php?page=...anslating+LimeSurvey
Last Edit: 5 years 7 months ago by greg_d.

Please Log in to join the conversation.

More
5 years 5 months ago #64463 by madopr
And isn't there a way to have a different text for surveys in the same language?

Please Log in to join the conversation.

More
5 years 5 months ago #64467 by DenisChenu

madopr wrote: And isn't there a way to have a different text for surveys in the same language?

Hello,

Maybe if we understand why you want to do this, we can propose a solution.

You can use conditionnal question, or quota to present different text for example.

What text dis you want to show and when ?

:)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
5 years 5 months ago #64468 by madopr
I just need to have an specific text in the token page of one survey (at the request of a client) and this text would have no sense for the rest of my surveys.

Please Log in to join the conversation.

More
5 years 5 months ago #64469 by DenisChenu
Hello,

I think you can use a specific template for THIS survey. An in this template add what you want in the file register.pstpl of the template.

The survey is multilingual ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
5 years 5 months ago - 5 years 5 months ago #64470 by madopr
Yes; and the text I want to change isn't the one of the registration page. It's the one in the page that asks you for a token; the first page of a restricted survey (the one that says: "This is a controlled survey. You need a valid token to participate...")
Last Edit: 5 years 5 months ago by madopr.

Please Log in to join the conversation.

More
5 years 5 months ago #64483 by madopr
I figured out how to do this:
First, you have to create a template for your survey (and just for this survey).
In the question page, add this code to the end of the survey.pstpl file:
<div id="pedirToken">
		<script charset="UTF-8">
		$(document).ready(function() {
			if ($('html').attr('lang')=='es') {
				document.getElementById('ENG').style.display='none';
			} else {
				document.getElementById('ESP').style.display='none';
			}
		});
		</script>
		<p id="ESP">"Texto en español"</p>
		<p id="ENG">"Text in English"</p>
	</div>

In the startgroup.pstpl add this code:
<script charset="UTF-8">
	$(document).ready(function() {
		document.getElementById('pedirToken').style.display='none';
	});
</script>

Finally, in the template.css file you have to search for "p#tokenmessage" and replace their styles (or create them if they aren't found) with this:
p#tokenmessage {
  display: none;
}

(In this example we have a survey with 2 languages: English and Spanish)

Please Log in to join the conversation.

More
5 years 5 months ago #64520 by DenisChenu
Great job !
The idea to remove the token part in startgroup is great !

Can you put this in our workaround documentation part please ?

docs.limesurvey.org/Workarounds%3A+Manip...tions+for+LimeSurvey

Thanks a lot

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
5 years 5 months ago - 5 years 5 months ago #64529 by madopr
You are welcome!
I've put my previous message as a comment in the workarounds page
Last Edit: 5 years 5 months ago by madopr.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form