I have an English site that uses Structure and Transcribe. The 2 language translations, French and German, are about to go live except for one little issue. On one page I have a contact form using Freeform Pro that also contains the 'Thank you' text that is shown once the form has been submitted, using a Freebie tag. It has been working fine for the English (default) version of the site. The form goes from www.mysite.com/contact-us to www.mysite.com/contact-us/thanks once the form is submitted.
The code I've used. is below:
{if freebie_last == "thanks"}
<p>{contact_thanks}</p>
{if:else}
{contact_info}
{exp:freeform:form
form_id="1"
required="name|email|country|area_of_interest|user_enquiry"
return="{segment_1}/thanks"
inline_errors="yes"
form:class="well"
}
Unfortunately I can't work out how to get the translations to show the correct 'Thank you' page. When I'm on www.mysite.com/de/kontakt and hit Submit I am taken to the 404 page because it's trying to direct to www.mysite.com/kontakt/thanks. It should be www.mysite.com/de/kontakt/thanks - it's not including the 'de' segment of the url.
I've tried several variations of the return path but none seem to direct me to www.mysite.com/de/kontakt/thanks. The language segment is always being removed, but I need to keep the return="{segment_1}/thanks for the English version of the site to work. I was thinking an {if} statement would be needed but nothing seems to be working.
I've tried:
{if '{transcribe:language_abbreviation}' == 'de'}
return="{freebie_1}/{freebie_2}/thanks"
{if:else}
return="{segment_1}/thanks"
{/if}
or:
{if '{transcribe:language_abbreviation}' == 'de'}
return="{segment_1}/{segment_2}/thanks"
{if:else}
return="{segment_1}/thanks"
{/if}
Does {if:else} not work here? If not, what does? Or am I going about this in totally the wrong way by using Freebie (I'm a bit unsure how it works). I've tried adding fr|de to the breaking segments to no avail.
Any help would be appreciated. Thanks