Welcome, Guest
Username: Password: Remember me

TOPIC: QuestionID as Variable

QuestionID as Variable 2 years 6 months ago #78013

  • getter
  • getter's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 13
  • Karma: 0
We developed for us an template whis is common enough to do (actually) all surveys. We want to use it for a lot of purposes, but always change the logo. For this it would bi nice to have the SurveyID as a variable, so we could insert the logo by using <img src={SurveyID}.jpg/>

This is our workarround
<script type="text/javascript" charset="utf-8">
$(document).ready(function () { 
  var sID = document.getElementById("sid"); 
  $('#customLogo').append('<img src="'+sID.value+'.jpg"/>');
});
</script>
Last Edit: 2 years 6 months ago by getter.
The administrator has disabled public write access.

Re: QuestionID as Variable 2 years 6 months ago #78017

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4272
  • Thank you received: 806
  • Karma: 369
You can use the {SID} placeholder in the template .pstpl file. Something like:
<div id="customLogo">
	<img src="{TEMPLATEURL}logoImage-{SID}.png">
<div>
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: QuestionID as Variable 2 years 6 months ago #78034

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
tpartner wrote:
You can use the {SID} placeholder in the template .pstpl file. Something like:
<div id="customLogo">
	<img src="{TEMPLATEURL}logoImage-{SID}.png">
<div>
Great solution, I added it at: docs.limesurvey.org/The+template+editor#...with_different_logos

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.116 seconds
Donation Image