custom error page / redirect wich accepts parameters?

1 year 11 months ago #173269 by achstil
For a specific survey I would like a custom error page.

When a user request a survey with a token that has zero uses left, limesurvey presents the errorpage: "This invitation has already been used".

I would like the user to instead be redirected to a custom url, with the token passed as a parameter.

Eg. token "abc" tries to access surveyID = "123". Instead of the errorpage I would like to redirect to

What is the best way to make that possible? Maybe with a custom theme page with a html redirect ind the header?

The topic has been locked.
LimeSurvey Partners
1 year 11 months ago #173273 by tpartner
You can modify layout_errors.twig. Maybe something like this:

{% if aError.type == 'survey-notstart' %}
	<!-- Redirect code here... -->
{% else %}
	<!-- Core error article here... -->
	<article id="block_error">
			{% if aError.error %}
				<h1>{{ aError.error }}</h1>
			{% endif %}
			<h2>{{ aError.title }}</h2>
				{{ aError.message }}
				{% if %}
					{{ }}
				{% else %}
					{{gT("For further information please contact %s:")|format (aSurveyInfo.adminname)}}
					{% if aSurveyInfo.adminemail %}
						<a href='mailto:{{ aSurveyInfo.adminemail }}'>{{ aSurveyInfo.adminemail }}</a>
					{% endif %}
				{% endif %}
{% endif %}

Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner -
The topic has been locked.

Start now!

Just create your account and start using Limesurvey today.

Register now