Welcome to the LimeSurvey Community Forum

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

image hide/display

  • swatib
  • swatib's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 2 weeks ago #227820 by swatib
image hide/display was created by swatib
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.2.12
Survey theme/template: fruity
=================

I want to show one image(logo) on access and welcome screen.
And other image(logo) on question screen but on same place.
How I implement this using css? or any other idea please suggest if their is any condition.  

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 2 weeks ago #227851 by tpartner
Replied by tpartner on topic image hide/display
You can detect the welcome screen in a twig file like this:

Code:
{% if (aSurveyInfo.aNavigator.show and aSurveyInfo.include_content == 'firstpage')  %}
  <!-- Do something in the Welcome page -->
  This is the welcome page!
{% endif %}

Upload the welcome logo with the same name as the normal logo except appended with "_welcome". So the two files are something like myLogo.png and myLogo_welcome.png.

In nav_bar.twig, replace this line:

Code:
{{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {"class": "logo img-responsive"}) }}

With something like this:

Code:
{% set logoFilePath = aSurveyInfo.options.brandlogofile %}
{% if (aSurveyInfo.aNavigator.show and aSurveyInfo.include_content == 'firstpage')  %}
  {% set logoFilePath = aSurveyInfo.options.brandlogofile|replace({'.png': '_welcome.png', '.jpg': '_welcome.jpg'}) %}
{% endif %}
{{ image(logoFilePath, aSurveyInfo.name, {"class": "logo img-responsive"}) }}

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.

Lime-years ahead

Online-surveys for every purse and purpose