help for redirect_page tag

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
unicorn
New Member
New Member
Posts: 3
Joined: Mon Nov 23, 2015 11:26 am

help for redirect_page tag

Post by unicorn »

hi,
i am building a multilingual web site. i used "browser language" and "redirect page" tags on main page, so i can redirect visitors to the page in their language...

problem is that i want to insert a photo and give a short message to visitors in their language but i could not do that.

Code: Select all

{browser_lang accepted='fr,ru,en,es' default='en' assign='lang'}

{if $lang == 'fr'}
      {redirect_page page="fr"}
 {elseif $lang == 'ru'}
      {redirect_page page="ru"}
 {elseif $lang == 'es'}
      {redirect_page page="es"}
 {else}
     {redirect_page page="en"}
{/if}
no matter what code i entered between these functions, it did not work, and redirected directly...

what i tried ? php sleep, jq and java timeout etc. but it does not read the code between functions.

lets say browser language is Spanish , it should give message "bienvenida", wait 5 seconds and after redirect page to es.

could you help me ?

thank you.
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm

Re: help for redirect_page tag

Post by Jeff »

All smarty is rendered on the server, if you want a page display before the redirect, store the {$lang} variable or the redirectpage in a js var and then have js do a redirect (window.location = newpage) after the delay that you want.
Post Reply

Return to “The Lounge”