Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Access code page

  • CarlottaToletti
  • CarlottaToletti's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #224599 by CarlottaToletti
Access code page was created by CarlottaToletti
Please help us help you and fill where relevant:
Your LimeSurvey version:   Version 5.2.10
Own server or LimeSurvey hosting:  LimeSurvey Cloud
Theme: Issue change text
==================
Hello!

Is it possible to change the text in the access code page ?
I would like to modify title and message

Attached the page i am referring to.

Thanks!
 
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #224601 by holch
Replied by holch on topic Access code page
Not sure, but these texts are probably within the translation files.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #224602 by Joffm
Replied by Joffm on topic Access code page
Like this?
 

I put this in the "custom.js" of my extended theme
Code:
$(document).on('ready pjax:scriptcomplete',function(){
  $('.token-page .h3').text("XXXXXXXXXXXXXXXXX");
  $('.token-page p.text-info').text("YYYYYYYYYYYYYYYYYYYY");
  $('.token-page .control-label').text("ZZZZZZZZZZZZZZZZZZ"); 
});

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: holch
The topic has been locked.
More
3 years 4 months ago #224603 by jelo
Replied by jelo on topic Access code page

I put this in the "custom.js" of my extended theme

How do you handle a multi-languages survey with this workaround?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #224605 by Joffm
Replied by Joffm on topic Access code page

How do you handle a multi-languages survey with this workaround?

I do not because it was not required.

But you can add this by something like
Code:
var lang = "{LANG}";
  if(lang=='en') {
var newtext1="AAAA";
var newtext2="BBBBB";
....
} elseif(lang=='it') {
var newtext2="BBBBB";
....
}
$('.token-page .h3').text(newtext1);
...

As far as I understand these requirements, this variation of the text is used in only one special survey.
So I did not mention something like
  • adapt the "token.twig"
  • change the translation file

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #224611 by tpartner
Replied by tpartner on topic Access code page
You should be able to do it in the theme twig files.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
More
3 years 4 months ago - 3 years 4 months ago #224618 by jelo
Replied by jelo on topic Access code page
Thanks for your ideas. Still hoping for a feature to override all text at a central place inside a survey. So that you don't needs to create a language file and don't have to override text via if constructs in a survey with more than one language. But that is a different topic.

 

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Last edit: 3 years 4 months ago by jelo.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
3 years 4 months ago - 3 years 4 months ago #224640 by DenisChenu
Replied by DenisChenu on topic Access code page

Thanks for your ideas. Still hoping for a feature to override all text at a central place inside a survey. So that you don't needs to create a language file and don't have to override text via if constructs in a survey with more than one language. But that is a different topic.



 
When this one is OK : github.com/LimeSurvey/LimeSurvey/pull/2213
I create a plugin event.

BUT : doing it in Theme twig file is really the best solution : github.com/LimeSurvey/LimeSurvey/blob/ma...omponents/token.twig

My opinion: create a complete system to have it by surey for ALL language string make a really complex system.
If you don't show all language string, but only replaced one : user don't known what is the string to replace "Submit" or "Next" for example ...

I already have an old plugin for error page *. But now : theme twig edition is really better.

* gitlab.com/SondagesPro/coreAndTools/adaptEnterErrorSurveyText
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
Last edit: 3 years 4 months ago by DenisChenu. Reason: More detail
The topic has been locked.
More
3 years 4 months ago #224650 by jelo
Replied by jelo on topic Access code page

My opinion: create a complete system to have it by surey for ALL language string make a really complex system.
If you don't show all language string, but only replaced one : user don't known what is the string to replace "Submit" or "Next" for example ...
 
It's the way many survey tools implement multilanguage into their applications. One of the biggest feature LimeSurvey has, is the way it handles multi-language surveys. You won't find many surveytools allowing to edit the complete question in different languages. Most have have only a export / import function to translate everything into a different language. No way to e.g. place the images visually for the different languages. That big "pro" for LimeSurvey is not promoted to potential users. To allow overriding/suppressing/control every system message per survey is an common feature.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #224654 by tpartner
Replied by tpartner on topic Access code page
Something like this in token.twig:
 
 
Code:
{% extends "./subviews/logincomponents/captcha.twig" %}
 
{% set text1 = {
    'en': "My custom header text.",
    'fr': "Mon texte de titre personnalisé.",
    'de': "Mein benutzerdefinierter Titeltext."
  }
%}
{% set text2 = {
    'en': "My custom instructions.",
    'fr': "Mes instructions personnalisées.",
    'de': "Meine individuelle Anleitung."
  }
%}
{% set text3 = {
    'en': "Custom label",
    'fr': "Étiquette personnalisée",
    'de': "Benutzerdefiniertes Etikett"
  }
%}
{% set lang = aSurveyInfo.languagecode %}
 
    {% block formheading %}
        {{ text1[lang] }}
    {% endblock %}
 
    {% block description %}
        <p class='{{ aSurveyInfo.class.maincoldivdivbp }} text-info' {{ aSurveyInfo.attr.maincoldivdivbp }}>
            {% if aSurveyInfo.aForm.token == null  %}
                {{ text2[lang] }}
            {% else %}
                {{ gT("Please confirm the token by answering the security question below and click continue.") }}
            {% endif %}
        </p>
    {% endblock %}
 
 
    {% block formcontent  %}
 
        <div class='{{ aSurveyInfo.class.maincolform }} form-group' {{ aSurveyInfo.attr.maincolform }}>
            <label class='{{ aSurveyInfo.class.maincolformlabel }} control-label col-sm-3' {{ aSurveyInfo.attr.maincolformlabel }}>
                <small class="{{ aSurveyInfo.class.maincolformlabelsmall }} text-danger asterisk fa fa-asterisk small " {{ aSurveyInfo.attr.maincolformlabelsmall }} ></small>
               {{ text3[lang] }}
                <span class="{{ aSurveyInfo.class.maincolformlabelspan }} sr-only text-danger asterisk " {{ aSurveyInfo.attr.maincolformlabelspan }}>
                    ( {{ gT("Mandatory") }} )
                </span>
 
            </label>
 
      ...

 

 

 

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu, Joffm
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #224661 by tpartner
Replied by tpartner on topic Access code page
... this is better as it defaults to the core translation string if not defined in token.twig for a given language:

Code:
{% extends "./subviews/logincomponents/captcha.twig" %}
 
{% set lang = aSurveyInfo.languagecode %}
 
{% set aText1 = {
    'en': "My custom header text.",
    'fr': "Mon texte de titre personnalisé.",
    'de': "Mein benutzerdefinierter Titeltext.",
    'default': gT("To participate in this restricted survey, you need a valid token.")
  }
%}
{% if aText1[lang] is defined %}
  {% set text1 = aText1[lang] %}
{% else %}
  {% set text1 = aText1['default'] %}
{% endif %}
 
{% set aText2 = {
    'en': "My custom instructions.",
    'fr': "Mes instructions personnalisées.",
    'de': "Meine individuelle Anleitung.",
    'default': gT("If you have been issued a token, please enter it in the box below and click continue.")
  }
%}
{% if aText21[lang] is defined %}
  {% set text2 = aText2[lang] %}
{% else %}
  {% set text2 = aText2['default'] %}
{% endif %}
 
{% set aText3 = {
    'en': "Custom label",
    'fr': "Étiquette personnalisée",
    'de': "Benutzerdefiniertes Etikett",
    'default': gT("Token:")
  }
%}
{% if aText3[lang] is defined %}
  {% set text3 = aText3[lang] %}
{% else %}
  {% set text3 = aText3['default'] %}
{% endif %}
 
    {% block formheading %}
        {{ text1 }}
    {% endblock %}
 
    {% block description %}
        <p class='{{ aSurveyInfo.class.maincoldivdivbp }} text-info' {{ aSurveyInfo.attr.maincoldivdivbp }}>
            {% if aSurveyInfo.aForm.token == null  %}
                {{ text2 }}
            {% else %}
                {{ gT("Please confirm the token by answering the security question below and click continue.") }}
            {% endif %}
        </p>
    {% endblock %}
 
 
    {% block formcontent  %}
 
        <div class='{{ aSurveyInfo.class.maincolform }} form-group' {{ aSurveyInfo.attr.maincolform }}>
            <label class='{{ aSurveyInfo.class.maincolformlabel }} control-label col-sm-3' {{ aSurveyInfo.attr.maincolformlabel }}>
                <small class="{{ aSurveyInfo.class.maincolformlabelsmall }} text-danger asterisk fa fa-asterisk small " {{ aSurveyInfo.attr.maincolformlabelsmall }} ></small>
               {{ text3 }}
                <span class="{{ aSurveyInfo.class.maincolformlabelspan }} sr-only text-danger asterisk " {{ aSurveyInfo.attr.maincolformlabelspan }}>
                    ( {{ gT("Mandatory") }} )
                </span>
 
            </label>
 
      ...

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
3 years 4 months ago #224701 by DenisChenu
Replied by DenisChenu on topic Access code page

 To allow overriding/suppressing/control every system message per survey is an common feature.
 
:)

Yes : and i still think for «core» string usage of twig is the best.
We still have a real Theme Permission system (like survey and SurveyGroups) but exceot this : you can realky update anything.

It's the reason I ask twig file for all wen feature now : github.com/LimeSurvey/LimeSurvey/pull/22...uestreview-875606933

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose