Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: How can I use a different logo for each survey, but without changing de template

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #109980

  • helviobrito
  • helviobrito's Avatar
  • Offline
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
Hi.

Please help me. I've alreedy looked into the forum and the mamual and didn't find a clear answer for may issue.

I use LM 2.05+ Build 140302 and a mdified version of Vallendar template. I need to change the logo for each survey, but I didn't figure out how to do this. Can anone help me?
The administrator has disabled public write access.

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110000

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6308
  • Thank you received: 1407
  • Karma: 546
In the template file, you can use the placeholder for the survey ID in the filename of the logo image.

So, something like:

<img src="path/to/images/logo-{SID}.png" />

.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: helviobrito

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110022

  • helviobrito
  • helviobrito's Avatar
  • Offline
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
Thanks for your attention, tpartner. But, please, I'd like to know which template file I'll use to put this line in: survey. pstpl or starpage.pstpl?
The administrator has disabled public write access.

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110023

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6308
  • Thank you received: 1407
  • Karma: 546
It depends on where your logo is - probably in startpage.pstpl.

What template are you using? Can you activate a sample survey?


.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110024

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6308
  • Thank you received: 1407
  • Karma: 546
It depends on where your logo is - probably in startpage.pstpl.

What template are you using? Can you activate a sample survey?


.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110025

  • helviobrito
  • helviobrito's Avatar
  • Offline
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
I am using Vallendar, with a little modification only to change the color of warning texts from pink to red.

Here is a survey that you can see as an example: focuspesquisa.com.br/focusOnline/181521/lang-pt-BR.

See the logo focusOnline in the questions page? I'd like to change it only in this survey, for example, not affecting the others active ones.
The administrator has disabled public write access.

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110027

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5176
  • Thank you received: 769
  • Karma: 230
Can't access the survey without a token and on the startpage there is no logo.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110028

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5176
  • Thank you received: 769
  • Karma: 230
But Tpartners solution would affect all other surveys that depend on this template that you use.

But I think it is a very elegant solution, if you have many surveys and they all need a different logo. You just put the logo file into the respective folder with the Survey ID in the file name and the template will use this file.

However, this change will affect all previous surveys, because they don't have the correct name and one disadvantage is that you would have to create a logo file for each survey, even if the logo stays the same. So if you usually use always one logo and just for this survey you need to use another one, I think it is easier to copy the template and change the logo file.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110029

  • helviobrito
  • helviobrito's Avatar
  • Offline
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
Sorry. Use the login Testing and the token 123456.

So, I think that the logo goes in the survey.pstpl. My generic logo url is there. So, supose I have an image named newlogo.png and I want it just in the survey with the ID 181521. Do I change the images's name to newlogo-181521.png?
The administrator has disabled public write access.

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110030

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6308
  • Thank you received: 1407
  • Karma: 546
Yeah, no access for me either.

I think it is easier to copy the template and change the logo file.
No, we can do it dynamically for a single with JavaScript but I would need to see a survey to give the script details.


.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110031

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6308
  • Thank you received: 1407
  • Karma: 546
Still don't see a logo. That survey is using the default template with no logos.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110032

  • helviobrito
  • helviobrito's Avatar
  • Offline
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
Yes, I agree. I didn't think of copy the template for each survey. But I had a doubt it the logo name with the survey ID solution wouldn't affect all previous surveys, as you said, hotch. Thanks.
The administrator has disabled public write access.

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110033

  • helviobrito
  • helviobrito's Avatar
  • Offline
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
Plase, try again. Now the template is right.
The administrator has disabled public write access.

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110051

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6308
  • Thank you received: 1407
  • Karma: 546
But I had a doubt it the logo name with the survey ID solution wouldn't affect all previous surveys, as you said, hotch.
I made that suggestion before you said you had other surveys that you don't want affected.


If you want to insert a logo only for survey ID 181521, you can add this to the end of template.js. This will insert the defined image before your survey description.

$(document).ready(function(){
	// Image URL
	var imagePath = 'http://www.google.com/logos/2011/thai_elephant_day11-hp.jpg';
 
	// Insert the image
	if($('input#sid').val() == 181521) {
		$('td.survey-description').prepend('<img class="logo-image" src="'+imagePath+'" />');
	}
});


.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

How can I use a different logo for each survey, but without changing de template 2 years 3 months ago #110065

  • helviobrito
  • helviobrito's Avatar
  • Offline
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
Thanks, tpartner. I'll try this solution and report the result to you.
The administrator has disabled public write access.
Time to create page: 0.259 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form