Up until this point I have always hard coded links to info pages and the like onto the template. Maybe some in header and some in footer etc...all exactly where I want them to appear.
However, I've just done my first opencart site with 2 languages and quickly found out when a user changes to German, for example, nothing changes obviously on these hard coded parts.
So...my question is...how do I add a link to template without hard coding it?
Issue number 2 is when I have placed a strapline on a site...let's say I've added the words 'build, belong, believe' in the header template next to logo...this is obviously hard coded too...so how can I added these words so they are translated? Do I create a new language string for example?
Many thanks in advance
Gav
Code: Select all
$_['text_my_work'] = 'My Work';
$_['text_my_projects'] = 'My Projects';
Code: Select all
<?php global $language; echo $language->get('text_my_work'); ?>
http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension
Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme
Extra Positions PRO, Custom JavaScript, Custom CSS and others
Just need to figure out adding information pages into template without hard coding then.
Thanks
What code do I need to place on template to call in..
A Specific info page (lets say ID 3)
But...not hard code the text between the link to ID3...as otherwise it won't work with other languages
Need the trigger text to pick up my 2nd language (German)
If anyone can give some pointers that would be great.
Thanks
Code: Select all
<?php global $url; echo $url->link('information/information', 'information_id=1'); ?>
http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension
Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme
Extra Positions PRO, Custom JavaScript, Custom CSS and others
Thanks
Gavin
You should try to follow the above solution: http://forum.opencart.com/viewtopic.php ... 18#p549652redelevencreative wrote:Ah great thanks...but if I am hard coding the word 'link' what happens in the second language?
Thanks
Gavin
http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension
Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme
Extra Positions PRO, Custom JavaScript, Custom CSS and others
English title
German title
So can't these be drawn in to create the link text?
Rather than creating a language string
Thanks

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension
Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme
Extra Positions PRO, Custom JavaScript, Custom CSS and others
Users browsing this forum: No registered users and 4 guests