custom error page / redirect wich accepts parameters?

More
2 months 2 weeks ago #173269 by achstil
achstil created the topic: custom error page / redirect wich accepts parameters?
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 www.example.com/my_customerror_page?token=abc&surveyid=123


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

Sincerely

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #173273 by tpartner
tpartner replied the topic: custom error page / redirect wich accepts parameters?
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">
		<div>
			{% if aError.error %}
				<h1>{{ aError.error }}</h1>
			{% endif %}
			<h2>{{ aError.title }}</h2>
			<p>
				{{ aError.message }}
			</p>
			<p>
				{% if aError.contact %}
					{{ aError.contact }}
				{% else %}
					{{gT("For further information please contact %s:")|format (aSurveyInfo.adminname)}}
					{% if aSurveyInfo.adminemail %}
						<br>
						<a href='mailto:{{ aSurveyInfo.adminemail }}'>{{ aSurveyInfo.adminemail }}</a>
					{% endif %}
				{% endif %}
			</p>
		</div>
	</article>
{% endif %}


Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!