Jump to content

Extending Languages template


Peter Knight
 Share

Recommended Posts

I have a dropdown menu which displays a list of languages installed on my site. 

Id like to add some country flags to the menu list items and the simplest way would be to add an image field to the languages template which is installed in the settings branch. 

However it seems like this system template won't accept new fields but isn't locked. Is there a way to extend this template to accept new fields?

P

 

Link to comment
Share on other sites

Hi @Peter Knight

I didn't add image field to langauge template, but I have added several custom text fields in every install, so there is no problem to add your custom fields. Just set "Show system templates" in tempalate manager filter, I think you are aware about it.

As an alternative you can put your flags to some template/assets/images/flags/ and name it like default.png, english.png etc. and then use $language->name in your foreach loop.

 

 

  • Like 2
Link to comment
Share on other sites

  On 6/12/2017 at 7:37 AM, ottogal said:

I have no answer to your question, but would like to mention that using flags as language indicators is not the best idea:

why-flags-do-not-represent-language

Expand  

Interesting read and I'll bring it up with the site owners.

This is actually a port from another CMS to Processwire (wohoo). The original site already uses a flag system and language names in local format so I have to stick with that.

 

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...