- Posts: 168
- Thank you received: 2
Ask the community, share ideas, and connect with other LimeSurvey users!
I know, but I think it's problematic.DenisChenu wrote: You can udate the mlanguage changer in theme and create your own.
github.com/LimeSurvey/LimeSurvey/blob/ma...anguage_changer.twig
github.com/LimeSurvey/LimeSurvey/blob/ma...nger_first_page.twig
github.com/LimeSurvey/LimeSurvey/blob/ma...hanger_top_menu.twig
<body style="padding-top: 90px;" class=" {{ aSurveyInfo.class.body }} font-{{ aSurveyInfo.options.font }} lang-{{aSurveyInfo.languagecode}} {{aSurveyInfo.surveyformat}} {% if( aSurveyInfo.options.brandlogo == "on") %}brand-logo{%endif%}" {{ aSurveyInfo.attr.body }} data-sid="{{ aSurveyInfo.sid }}">
body[data-sid="123456"] a.ls-language-link[data-limesurvey-lang="fr"] { display: none; }
$(document).on('ready pjax:scriptcomplete',function(){ $('body[data-sid="123456"] a.ls-language-link[data-limesurvey-lang="fr"]').closest('li').remove(); });
tpartner wrote: I would prefer to use the JS as it completely removes the link so it would not be available even to keyboard navigation.
body[data-sid="123456"] a.ls-language-link[data-limesurvey-lang="fr"] { display: none; }
This workaround only removes the link from the language selector (per your original post) it does not disable the language so, of course, you will be able to access it with a URL parameter.If site is in English:
1. starting survey
2. No "pt-BR"
If site is in "pt-BR"
1. Starting survey
2. survey is in "pt-BR"
I need to learn more about keyboard navigation.DenisChenu wrote:
tpartner wrote: I would prefer to use the JS as it completely removes the link so it would not be available even to keyboard navigation.
diable keyboard navigation to lang fr tooCode:body[data-sid="123456"] a.ls-language-link[data-limesurvey-lang="fr"] { display: none; }
With boostraptpartner wrote: ...
I need to learn more about keyboard navigation.
tpartner wrote: If you need it to be survey-specific, edit layout_global.twig to add a survey ID attribute to the <body> tag.
Code:<body style="padding-top: 90px;" class=" {{ aSurveyInfo.class.body }} font-{{ aSurveyInfo.options.font }} lang-{{aSurveyInfo.languagecode}} {{aSurveyInfo.surveyformat}} {% if( aSurveyInfo.options.brandlogo == "on") %}brand-logo{%endif%}" {{ aSurveyInfo.attr.body }} data-sid="{{ aSurveyInfo.sid }}">
Then you can target the language link(s) by survey ID and language.
Either hide it with CSS - something like this in your custom.css file:
Code:body[data-sid="123456"] a.ls-language-link[data-limesurvey-lang="fr"] { display: none; }
Or remove it with JavaScript - something like this in your custom.js file:
Code:$(document).on('ready pjax:scriptcomplete',function(){ $('body[data-sid="123456"] a.ls-language-link[data-limesurvey-lang="fr"]').closest('li').remove(); });