Best way to enable optional additional Logo for each Survey

Plus d'informations
il y a 1 mois 3 semaines #193682 par 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

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
Plus d'informations
il y a 1 mois 3 semaines - il y a 1 mois 3 semaines #193692 par tpartner
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.

{# 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.
Official LimeSurvey Partner - partnersurveys.com
Dernière édition: il y a 1 mois 3 semaines par tpartner.
Les utilisateur(s) suivant ont remercié: cdorin, lucasdidthis

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #193708 par DenisChenu
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.

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 .
An error happen ? Before make a new topic : remind the Debug mode .
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #193712 par jelo

DenisChenu écrit: 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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines - il y a 1 mois 3 semaines #193716 par lucasdidthis
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!
Dernière édition: il y a 1 mois 3 semaines par lucasdidthis.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #193729 par Joffm
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


Volunteers are not paid.
Not because they are worthless, but because they are priceless

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #193730 par tpartner
What LimeSurvey version are you using?

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.
Official LimeSurvey Partner - partnersurveys.com

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #193733 par 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 .
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 3 semaines #193734 par DenisChenu

jelo écrit: I suspect the work you have to invest into answering RFQ and handling is more expensive than the willingness to pay.

Yes, maybe and ?

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 .
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 2 semaines #194323 par lucasdidthis
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! :)

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 1 semaine #194332 par surveySn
Hi lucasdidthis

Could you share your solutions?

I have the same problem,Thank you,

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 1 semaine - il y a 1 mois 1 semaine #194412 par lucasdidthis
Sure. I just added
onerror="this.alt='missing image';"
to the image-tag with the second logo and use
img[alt='missing image']{
display:none;
}
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.
Dernière édition: il y a 1 mois 1 semaine par lucasdidthis.

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!