Thanks, it works perfect!
Could it be possible to change language words into a flag pictures?
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
- Previous 10 entries
- 1
- Page 22(current)
One option is <img src ="$Locale.png" /> Or better yet is a php function that gives the right path
Or you use the class="$Locale" in your css file (with li.de-DE a for instance) to change the background of the href for link and hover
I've used a space in the code:
<img src ="themes/mytheme/images/$Locale .png" alt="$Title" />
And flag picture names are respectively "en_GB .png" & "lt_LT .png" - now works perfect.
Not sure why did'n work without a space - checked final html code and observed that $Locale argument wasn't grabbed...
Try putting curly brackets around your variable or else .png is read as a property or method for $Locale.
<img src ="themes/mytheme/images/{$Locale}.png" alt="$Title" />
Cheers yurigoul, your _config.php code worked for me, fixing this DB build error:
Unknown column 'SiteTree.Locale' in 'where clause'
- Previous 10 entries
- 1
- Page 22(current)