unable to edit link

Popular automatic website translation tool

unable to edit link

Postby earthpulse » Fri Jan 23, 2015 2:38 pm

Hi,

I'm not able to edit the link for a button on a page (points to external website)

Any idea why? I am able to change other links but not that one

the external website is a shop. we need to change the link in language page so it points to the french language version of the shop.

Regards,
Sid
Last edited by earthpulse on Fri Jan 23, 2015 2:52 pm, edited 1 time in total.
earthpulse
 
Posts: 25
Joined: Mon Dec 22, 2014 9:12 am

Re: unable to edit link

Postby Edvard » Fri Jan 23, 2015 2:40 pm

Hi,

You cannot edit external links. If you want to change the link depending on the selected language you will need to program it on your side. You can check $_SERVER['HTTP_X_GT_LANG'] variable to detect selected language and depending on it change the link.

Thanks!
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4185
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: unable to edit link

Postby earthpulse » Fri Jan 23, 2015 2:53 pm

hi edvard,

can you tell me how to set that up.
All i can understand it involves the .htaccess file?
earthpulse
 
Posts: 25
Joined: Mon Dec 22, 2014 9:12 am

Re: unable to edit link

Postby Edvard » Fri Jan 23, 2015 3:09 pm

You need to find the source file where you add the link and add PHP script to check the language and show correct link.

It requires some basic PHP knowledge. This can be an example of code, you may consult with your developer:

Code: Select all
<?php
if(isset($_SERVER['HTTP_X_GT_LANG']) and $_SERVER['HTTP_X_GT_LANG'] == 'fr')
    echo '<a target="_blank" href="http://fr.sleep-tech.com"><img src="new-art/ia-up.png"></a>';
else
    echo '<a target="_blank" href="http://sleep-tech.com"><img src="new-art/ia-up.png"></a>';
?>
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4185
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: unable to edit link

Postby earthpulse » Fri Jan 23, 2015 4:46 pm

hi
im the developer so..i'll have to do it myself.

the website currently is HTML.
Should i simply add the code u sent me to the HTML pages? will that work?
i am also developing the same website in wordpress at the moment. In that case can i add that code to the footer?
earthpulse
 
Posts: 25
Joined: Mon Dec 22, 2014 9:12 am

Re: unable to edit link

Postby earthpulse » Fri Jan 23, 2015 4:52 pm

tried adding the code
https://fr.earthpulse.net/warranty-disclaimer.htm

getting an error :(

any idea how to get it to work?
earthpulse
 
Posts: 25
Joined: Mon Dec 22, 2014 9:12 am

Re: unable to edit link

Postby earthpulse » Fri Jan 23, 2015 6:11 pm

hi again

i noticed i am able to edit the other buttons link which is also an external link, but not the i agree button. all other external links seem editable without changing the domain name. in this case too the buttons link i want to change will only need edit after the domain name
from
https://sleep-tech.com
to
https://sleep-tech.com/?___store=fr
earthpulse
 
Posts: 25
Joined: Mon Dec 22, 2014 9:12 am

Re: unable to edit link

Postby Edvard » Sat Jan 24, 2015 12:05 pm

Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4185
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: unable to edit link

Postby earthpulse » Sun Jan 25, 2015 12:44 pm

hi edvard

i used .htaccess file on the website where i needed the redirection as per language

RewriteEngine On
RewriteCond %{HTTP_REFERER} .*xxx.org.*$ [OR]
RewriteCond %{HTTP_REFERER} .*yyy.org.*$ [OR]
RewriteCond %{HTTP_REFERER} .*zzz.com.*$ [OR]
RewriteCond %{HTTP_REFERER} .*aaa.net.*$
RewriteRule ^(.*)$ http://your_site/different_page/

this worked easily. u can recommend this to others as well

cheers
earthpulse
 
Posts: 25
Joined: Mon Dec 22, 2014 9:12 am

Re: unable to edit link

Postby earthpulse » Sun Jan 25, 2015 8:23 pm

found one more way to do this (since outgoing links to other domains were not customizable)

create en.htm (with meta redirect to the english versin of our other website)
fr.htm (with meta .. to fr version of our other domain site)

now its possible to change links to external sites for different languages without messing .htaccess or php

cheers
earthpulse
 
Posts: 25
Joined: Mon Dec 22, 2014 9:12 am

Re: unable to edit link

Postby Yana » Sun Jan 25, 2015 11:33 pm

Thank you!
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

2GLux