Welcome to the LimeSurvey Community Forum

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

Logo

  • lorenzomorosini
  • lorenzomorosini's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 months 6 days ago #256793 by lorenzomorosini
Logo was created by lorenzomorosini
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi, I would need to insert different logos in the same survey. Is it possible? If so, how? 
We have three possible paths within the survey, a kind of brand awareness.
We set an option button to the final part of the access link that automatically fills out a question that discriminates different users. We need to change in this way also the logos. 
Thanks,
best regards!

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 months 6 days ago #256812 by tpartner
Replied by tpartner on topic Logo
We cannot help as you have ignored the questions about your LimeSurvey installation.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • lorenzomorosini
  • lorenzomorosini's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 months 6 days ago - 2 months 6 days ago #256816 by lorenzomorosini
Replied by lorenzomorosini on topic Logo
Please help us help you and fill where relevant:
Your LimeSurvey version: Limesurvey Community Edition Versione 5.3
Own server or LimeSurvey hosting: LimeSurvey hosting
Survey theme/template: Fruity

You're right, it's my first time here.
Last edit: 2 months 6 days ago by lorenzomorosini.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 months 5 days ago - 2 months 5 days ago #256942 by tpartner
Replied by tpartner on topic Logo
You cannot access the value of a pre-loaded question from the Welcome page.

So,for example, assume the following:
- The logo images are stored in the theme /files/ directory
- The welcome page is disabled
- The pre-loaded question is a single-choice with code Q1
- The pre-loaded question has answer codes A1...A5

Extend your theme and place something like this in the nav_bar.twig file:

Code:
{% set imageNames = {
        'A1': 'logo1.png',
        'A2': 'logo2.png',
        'A3': 'logo3.png',
        'A4': 'logo4.png',
        'A5': 'logo5.png'
    } 
%}
 
{% set imageAltTexts = {
        'A1': 'Alt text 1',
        'A2': 'Alt text 2',
        'A3': 'Alt text 3',
        'A4': 'Alt text 4',
        'A5': 'Alt text 5'
    } 
%}
 
{% set imagePath  = processString('{TEMPLATEURL}')~'files/' %}
 
{% set q1  = processString('{Q1}') %}
{% if('>' in processString('{Q1}')) %}
    {% set q1  = processString('{Q1}')|split('>')[1]|split('<')[0] %}
{% endif %}
 
{% set imageName  = imageNames[q1] %}
 
{% set imageSrc  = imagePath~imageName %}
 
{% set imageAlt  = imageAltTexts[q1] %}
 
<!-- Bootstrap Navigation Bar -->
{% if(aSurveyInfo.class.navbar) %}
<div class="{{ aSurveyInfo.class.navbar }} navbar-fixed-top" {{ aSurveyInfo.attr.navbar }}>
    <div class="{{ aSurveyInfo.class.navbarheader }}  " {{ aSurveyInfo.attr.navbarheader }} >
        <button type="button" class="{{ aSurveyInfo.class.navbartoggle }}" {{ aSurveyInfo.attr.navbartoggle }}  >
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
 
        {# Logo option #}
        {% if( aSurveyInfo.options.brandlogo == "on") %}
            <div class="{{ aSurveyInfo.class.navbarbrand }} logo-container hidden-xs"  {{ aSurveyInfo.attr.navbarbrand }}  >
               <img src="{{imageSrc}}" alt="{{imageAlt}}" class="logo img-responsive" />
            </div>
        {% else %}
            <div class="{{ aSurveyInfo.class.navbarbrand }}"  {{ aSurveyInfo.attr.navbarbrand }} >
                {{ aSurveyInfo.name }}
            </div>
        {% endif %}
    </div>
    <div id="{{ aSurveyInfo.id.navbar }}" class="{{ aSurveyInfo.class.navbarcollapse }}" {{ aSurveyInfo.attr.navbarcollapse }} >
        <ul class="{{ aSurveyInfo.class.navbarlink }} navbar-right" {{ aSurveyInfo.attr.navbarlink }}>
            {{ include('./subviews/navigation/save_links.twig') }}
            {{ include('./subviews/navigation/clearall_links.twig') }}
            {{ include('./subviews/navigation/question_index_menu.twig') }}
            {{ include('./subviews/navigation/language_changer_top_menu.twig') }}
        </ul>
    </div>
</div>
{% endif %}

 

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 2 months 5 days ago by tpartner.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose