Choose language block - flags instead of dropdown

Permalink
I was trying to set my Choose language block to use flag-icons instead of dropdown menu but since im using my self made theme im supposed to add a custom template for this, right? So i copied "concrete/blocks/switch_language" to "application/blocks/" and tried to get my choose language block to use this template but it didnt work. So what am i doing wrong?

Wanhaonki
 
hutman replied on at Permalink Reply
hutman
If all you are trying to do is create a custom template you just need to copy

concrete/blocks/switch_language/view.php to application/blocks/switch_language/templates/name_of_custom_template.php

Then make adjustments to that file, you will probably need to clear the cache for it to show up in the Custom Templates dropdown.

The other thing to note is that there is already a flags Custom Template built into C5.7 so you don't really need to do this anymore, you just need to go to your Switch Language block on the front end of your site, click Design & Custom Template from the menu, click the Gear icon from the edit bar and select the Custom Template from the dropdown.
Wanhaonki replied on at Permalink Reply
Wanhaonki
Nothing happens when i click on the Gear icon. Tried 3 different browsers... Thats the reason i tought im going to have to make a custom template for my own theme. I copied view.php from switch_language to application/... like you told but still nothing happens when clicking the gear icon in design & custom template...? :O
hutman replied on at Permalink Reply
hutman
It sounds like you have a javascript error on your page that is causing the toolbar to not work correctly. Can you check your inspector and see if that is the case?
Wanhaonki replied on at Permalink Reply
Wanhaonki
Where can i find this Inspector? Could it be because of my Bootstrap navigation? Since when i login and the toolbar etc. is active my navigation doesnt work fully (no dropdown is available)?
hutman replied on at Permalink Reply
hutman
If you are using Chrome you should be able to hit F12 and the Developer Tools will come up, the Console tab will show any javascript errors.

If you are using Firefox get the Firebug plugin and check the Console there.

The menu issue also sounds like a javascript error.
Wanhaonki replied on at Permalink Reply
Wanhaonki
Google Maps API warning: SensorNotRequired:https://developers.google.com/maps/documentation/javascript/error-me...

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, checkhttp://xhr.spec.whatwg.org/.

The specified value "!" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

That is what i get when i click Design & Custom Template in edit mode, but nothing more when clicking gear icon.
hutman replied on at Permalink Reply
hutman
You don't have a copy of bootstrap or jquery in your theme that isn't the concrete core version do you? I've seen weird things happen when either of those two load multiples.
Wanhaonki replied on at Permalink Reply
Wanhaonki
Actually now that you mentioned i think i do. Bootstrap and jQuery (?) are loaded straight in my theme and apparently C5 loads them also? You can view the page here if you want:http://ilonasnailart.fi/fi/etusivu...
hutman replied on at Permalink Best Answer Reply
hutman
That's for sure the problem. You will either need to do a check to see if the user is logged in and not load those, or figure out how to load the core ones instead (the versions won't match yours). There are lots of resources for how to do that, so I'm sure you can find them.
Wanhaonki replied on at Permalink Reply
Wanhaonki
What would be the best solution, to use only the core versions of Bootstrap and jQuery, right? Am i right that Choose Language flags are just "regular" links so im able to hard code them to my theme if necessary? Big thanks for your help. :)
hutman replied on at Permalink Reply
hutman
Using the core versions would be advised, yes. As for if there is anything special about the flag links I am not sure, I haven't dove into a multilingual site with 5.7