Welcome, Guest
Username: Password: Remember me

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

How do you change the text for the page that checks for valid token? 2 years 10 months ago #61895

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!
The administrator has disabled public write access.

Re: How do you change the text for the page that checks for valid token? 2 years 10 months ago #61953

  • greg_d
  • greg_d's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 47
  • Thank you received: 7
  • Karma: 4
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: 2 years 10 months ago by greg_d.
The administrator has disabled public write access.

Re: How do you change the text for the page that checks for valid token? 2 years 8 months ago #64463

  • madopr
  • madopr's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
And isn't there a way to have a different text for surveys in the same language?
The administrator has disabled public write access.

Re: How do you change the text for the page that checks for valid token? 2 years 8 months ago #64467

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 5832
  • Thank you received: 711
  • Karma: 220
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 ?

:)
The administrator has disabled public write access.

Re: How do you change the text for the page that checks for valid token? 2 years 8 months ago #64468

  • madopr
  • madopr's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
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.
The administrator has disabled public write access.

Re: How do you change the text for the page that checks for valid token? 2 years 8 months ago #64469

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 5832
  • Thank you received: 711
  • Karma: 220
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 ?
The administrator has disabled public write access.

Re: How do you change the text for the page that checks for valid token? 2 years 8 months ago #64470

  • madopr
  • madopr's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
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: 2 years 8 months ago by madopr.
The administrator has disabled public write access.

Re: How do you change the text for the page that checks for valid token? 2 years 8 months ago #64483

  • madopr
  • madopr's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
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)
The administrator has disabled public write access.

Re: How do you change the text for the page that checks for valid token? 2 years 8 months ago #64520

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 5832
  • Thank you received: 711
  • Karma: 220
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
The administrator has disabled public write access.

Re: How do you change the text for the page that checks for valid token? 2 years 8 months ago #64529

  • madopr
  • madopr's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
You are welcome!
I've put my previous message as a comment in the workarounds page
Last Edit: 2 years 8 months ago by madopr.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.138 seconds
Donation Image