- Posts: 5
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Best way to enable optional additional Logo for each Survey
- lucasdidthis
- Topic Author
- Offline
- New Member
Less
More
4 years 2 months ago #193682
by lucasdidthis
Best way to enable optional additional Logo for each Survey was created by lucasdidthis
Hejhej!
I'm pretty new to LimeSurvey, so excuse me if this is a dump question, but my client wants the option to add a different (or even multiple) different Logo(s) for different Surveys (without altering the theme or changing the main logo).
Is there a way I can provide that option? At least a single, changing logo should be possible, shouldn't it? What code do I need to add to the nav_bar.twig? How does the client add the logo within the survey?
I hope the the question wasn't answered before, but I wasn't able to find anything really helpful with the search.
Thanks in advance, all the best
Lucas
I'm pretty new to LimeSurvey, so excuse me if this is a dump question, but my client wants the option to add a different (or even multiple) different Logo(s) for different Surveys (without altering the theme or changing the main logo).
Is there a way I can provide that option? At least a single, changing logo should be possible, shouldn't it? What code do I need to add to the nav_bar.twig? How does the client add the logo within the survey?
I hope the the question wasn't answered before, but I wasn't able to find anything really helpful with the search.
Thanks in advance, all the best
Lucas
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10101
- Thank you received: 3589
4 years 2 months ago - 4 years 2 months ago #193692
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Best way to enable optional additional Logo for each Survey
In nav_bar.twig, you can add something like this to the logo option block.
It will insert an image - logo.png - found in the survey resources image folder.
Your client can upload the survey-specific images via the Resources tab in the survey menu.
It will insert an image - logo.png - found in the survey resources image folder.
Your client can upload the survey-specific images via the Resources tab in the survey menu.
Code:
{# Logo option #} <div class="{{ aSurveyInfo.class.navbarbrand }} logo-container" {{ aSurveyInfo.attr.navbarbrand }} > <img src="upload/surveys/{{ aSurveyInfo.sid }}/images/logo.png" alt="{{ aSurveyInfo.name }}" class="logo img-responsive" /> </div>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 2 months ago by tpartner.
The following user(s) said Thank You: cdorin, lucasdidthis
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13622
- Thank you received: 2490
4 years 2 months ago #193708
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Best way to enable optional additional Logo for each Survey
In my opinion : best way is to add multiple logo system inside theme system.
In skelvanilla, i have 3 logo, then one can be the global one, and anoptherone the survey one
This need more work
but since it's a client : you can make a quote.
In skelvanilla, i have 3 logo, then one can be the global one, and anoptherone the survey one
This need more work
but since it's a client : you can make a quote.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Attachments:
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
4 years 2 months ago #193712
by jelo
I suspect the work you have to invest into answering RFQ and handling is more expensive than the willingness to pay.
This is a typical example for a LimeStore offer or Themebundle.
50-100 EUR per year for an constantly updated theme, which is actually working without consulting the forum for one fix here and another workaround here. Just working is the key. If LS3/LS4 is constantly breaking parts, it will turn into a support nightmare.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Best way to enable optional additional Logo for each Survey
DenisChenu wrote: This need more work
but since it's a client : you can make a quote.
I suspect the work you have to invest into answering RFQ and handling is more expensive than the willingness to pay.
This is a typical example for a LimeStore offer or Themebundle.
50-100 EUR per year for an constantly updated theme, which is actually working without consulting the forum for one fix here and another workaround here. Just working is the key. If LS3/LS4 is constantly breaking parts, it will turn into a support nightmare.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- lucasdidthis
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
4 years 2 months ago - 4 years 2 months ago #193716
by lucasdidthis
Replied by lucasdidthis on topic Best way to enable optional additional Logo for each Survey
Thank you very much @tpartner, works like a charm. Additional Question, though: Is there a way to check if a file exists (within the .twig file) in order to just display the logo if the file actually exists?
Can't get the PHP function file_exists to work and .twig does not seem to know a similar function.
Thanks again for the help!
Can't get the PHP function file_exists to work and .twig does not seem to know a similar function.
Thanks again for the help!
Last edit: 4 years 2 months ago by lucasdidthis.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12905
- Thank you received: 3969
4 years 2 months ago #193729
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Best way to enable optional additional Logo for each Survey
Hi,
if it doesn't exist it cannot be displayed.
In that case the alt-value is used.
In Tony's example the name of the survey is displayed.
If you don't want that, use: alt=" " or enter the path toan existing (default) image.
Only alt="" will show the "image not found" symbol.
Joffm
if it doesn't exist it cannot be displayed.
In that case the alt-value is used.
In Tony's example the name of the survey is displayed.
If you don't want that, use: alt=" " or enter the path toan existing (default) image.
Only alt="" will show the "image not found" symbol.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10101
- Thank you received: 3589
4 years 2 months ago #193730
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Best way to enable optional additional Logo for each Survey
What LimeSurvey version are you using?
In 4.x, you can create custom twig functions incorporating PHP.
In 4.x, you can create custom twig functions incorporating PHP.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13622
- Thank you received: 2490
4 years 2 months ago #193733
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Best way to enable optional additional Logo for each Survey
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13622
- Thank you received: 2490
4 years 2 months ago #193734
by DenisChenu
Else : skelvanilla is free , and can be easily apdated
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Best way to enable optional additional Logo for each Survey
Yes, maybe and ?jelo wrote: I suspect the work you have to invest into answering RFQ and handling is more expensive than the willingness to pay.
Else : skelvanilla is free , and can be easily apdated
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- lucasdidthis
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
4 years 2 months ago #194323
by lucasdidthis
Replied by lucasdidthis on topic Best way to enable optional additional Logo for each Survey
Thanks again for your help everyone. A lot of great input, but I went with a super simple JavaScript solution (to match the very limited budget of the client).
See you next time, have a good one everyone!
See you next time, have a good one everyone!
The topic has been locked.
- surveySn
- Offline
- Premium Member
Less
More
- Posts: 136
- Thank you received: 4
4 years 2 months ago #194332
by surveySn
Replied by surveySn on topic Best way to enable optional additional Logo for each Survey
Hi lucasdidthis
Could you share your solutions?
I have the same problem,Thank you,
Could you share your solutions?
I have the same problem,Thank you,
The topic has been locked.
- lucasdidthis
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
4 years 2 months ago - 4 years 2 months ago #194412
by lucasdidthis
Replied by lucasdidthis on topic Best way to enable optional additional Logo for each Survey
Sure. I just added
to the image-tag with the second logo and use
in the css stylesheet to hide the empty element.
It's not the cleanest solution, but it works and was super fast and easy to implement.
Code:
onerror="this.alt='missing image';"
Code:
img[alt='missing image']{ display:none; }
It's not the cleanest solution, but it works and was super fast and easy to implement.
Last edit: 4 years 2 months ago by lucasdidthis.
The topic has been locked.