mynewborn Posted June 26, 2015 Share Posted June 26, 2015 (edited) Hi, I putted a code into my header.tpl to get a link to Q & A and Contact. Wen people go on my website with the language dutch I want the link to the dutch page. When they us my site in French I want them to go to the Frence page. Can anyone help me out what i'm doing wrong? Website: www.mynewborn.be Code: <div class=" col-md-6"> <div class="bd-layoutcolumn-72"><div class="bd-vertical-align-wrapper"><div class=" bd-textblock-86 bd-tagstyles"> <p style=""><a href="{$link->getCMSLink('6', 'q-a')}" title="">{l s='Q & A'}</a> <a href="{$link->getPageLink('contact', true)}" title="">{l s='Contact'}</a><br style=""></p> </div></div></div> </div> Edited June 26, 2015 by mynewborn (see edit history) Link to comment Share on other sites More sharing options...
templatin Posted June 27, 2015 Share Posted June 27, 2015 (edited) Its very simple. You can use the variable {$lang_id} along with {if} statement and write the full URL of the page instead of writing "getPageLink". {if $lang_id == 1} <a href="Write_Full_URL_For_French">Contact</a> {/if} {if $lang_id == 2} <a href="Write_Full_URL_For_Dutch">Contact</a> {/if} Do not forget to replace the appropriate language ID which can be checked from Back-office > Localization > Languages. Edited June 27, 2015 by templatin (see edit history) Link to comment Share on other sites More sharing options...
mynewborn Posted June 27, 2015 Author Share Posted June 27, 2015 So this would be the code? <div class=" col-md-6"> <div class="bd-layoutcolumn-72"><div class="bd-vertical-align-wrapper"><div class=" bd-textblock-86 bd-tagstyles"> <p style="">{if $lang_id == 1} <a href="Write_Full_URL_For_French">Q & A</a> {/if} {if $lang_id == 2} <a href="Write_Full_URL_For_Dutch">Q & A</a> {/if} {if $lang_id == 1} <a href="Write_Full_URL_For_French">Contact</a> {/if} {if $lang_id == 2} <a href="Write_Full_URL_For_Dutch">Contact</a> {/if}<br style=""></p> </div></div></div> </div> I can't see the language ID on the backoffice like you say. Do I need to check it into database? Link to comment Share on other sites More sharing options...
templatin Posted June 27, 2015 Share Posted June 27, 2015 Yes, it should work. Its easy to find the language ID. Go to Back-office -> Localization -> Languages. The first column in the Languages table is the language ID. Link to comment Share on other sites More sharing options...
mynewborn Posted June 27, 2015 Author Share Posted June 27, 2015 I tried it and still doesn't work. This is the code at this moment. I checked the language ID and set correct. (just changed French and Dutch). <div class=" col-md-6"> <div class="bd-layoutcolumn-72"><div class="bd-vertical-align-wrapper"><div class=" bd-textblock-86 bd-tagstyles"> <p style="">{if $lang_id == 1} <a href="Write_Full_URL_For_Dutch">Q & A</a> {/if} {if $lang_id == 2} <a href="Write_Full_URL_For_French">Q & A</a> {/if} {if $lang_id == 1} <a href="Write_Full_URL_For_Dutch">Contact</a> {/if} {if $lang_id == 2} <a href="Write_Full_URL_For_French">Contact</a> {/if}<br style=""></p> </div></div></div> </div> </div> </div> </div> </div> Link to comment Share on other sites More sharing options...
templatin Posted June 27, 2015 Share Posted June 27, 2015 I have tested the code on my localhost and its working perfect. I hope you have replaced the "href" value with proper URL. Link to comment Share on other sites More sharing options...
mynewborn Posted June 27, 2015 Author Share Posted June 27, 2015 Now it works perfect! I need to set the code in Themler (editing program for website layout). Thanks for the great help! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now