Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Change css/style within a survey ?

Re: Change css/style within a survey ? 2 years 9 months ago #66237

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4054
  • Thank you received: 740
  • Karma: 341
All templates are different. I will need to see the source of the page to find where thhe image is in the DOM.
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: Change css/style within a survey ? 2 years 9 months ago #66257

  • muellers
  • muellers's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Karma: 0
the logo image in the running survey site is embedded as:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
	<head>
<link rel="stylesheet" type="text/css" media="all" href="http://server/limesurvey/scripts/jquery/css/start/jquery-ui.css" />
<link rel="stylesheet" type="text/css" media="all" href="http://server/limesurvey/scripts/jquery/css/start/lime-progress.css" />
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="http://server/limesurvey/scripts/jquery/jquery-ui.js"></script>
<link href="http://server/limesurvey/scripts/jquery/css/start/jquery-ui.css" media="all" type="text/css" rel="stylesheet" /><link href="http://server/limesurvey/scripts/jquery/css/start/lime-progress.css" media="all" type="text/css" rel="stylesheet" /><script type="text/javascript" src="http://server/limesurvey/scripts/jquery/jquery-ui.js"></script>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<title>Survey</title>
 
		<meta name="generator" content="LimeSurvey http://www.limesurvey.org" />
 
		<link rel="stylesheet" type="text/css" href="http://server/limesurvey/upload/templates/workload_neu/template.css" />
 
 
    <!-- The following CSS hides visual elements of the progress bar from screen readers. -->
    <style type="text/css" media="aural tty">
        progress-graph .zero, progress-graph .graph, progress-graph .cent { display: none; }
    </style>
 
 
	<script type="text/javascript" src="http://server/limesurvey/upload/templates/workload_neu/template.js"></script>
	<link rel="shortcut icon" href="http://server/limesurvey/upload/templates/workload_neu/favicon.ico" />
	<script type="text/javascript" src="http://server/limesurvey/scripts/survey_runtime.js"></script>
	</head>
	<body>
		<table width="80%" align="center" class="bf" cellpadding="0" cellspacing="11">
		<tr>
			<td>
 
<form method='post' action='http://server/limesurvey/index.php' id='limesurvey' name='limesurvey' autocomplete='off'>
      <!-- INPUT NAMES -->
      <input type='hidden' name='fieldnames' value='35951X2887X65570|35951X2887X65571|35951X2887X65572|35951X2887X65573|35951X2887X65574' id='fieldnames' />
	<table width="100%" cellpadding="2">
		<tr>
			<td width="30%"valign="middle" align="left"><img src="http://server/limesurvey/upload/templates/workload_neu/Workload_Logo_klein.png" alt="Logo Image" /></td>
			<td width="70%" valign="middle" align="right" class="survey-name">Title</td>
 
<td valign="bottom" align="center" width="100%">
 
				<table width="100%">
					</tr>
 
				</table>
			</td>
			<td valign="bottom" align="right" height="100%" width="100%"></td>
		</tr>
...
	</table>


content of survey.pstpl is:
	<table width="100%" cellpadding="2">
		<tr>
			<td width="30%"valign="middle" align="left"><img src="{TEMPLATEURL}Workload_Logo_klein.png" alt="Logo Image" /></td>
			<td width="70%" valign="middle" align="right" class="survey-name">{SURVEYNAME}</td>
 
<td valign="bottom" align="center" width="100%">
				<table width="100%">
					</tr>
 
				</table>
			</td>
			<td valign="bottom" align="right" height="100%" width="100%"></td>
		</tr>
	</table> 
Last Edit: 2 years 9 months ago by muellers.
The administrator has disabled public write access.

Re: Change css/style within a survey ? 2 years 9 months ago #66281

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4054
  • Thank you received: 740
  • Karma: 341
1) Set up your survey to use JavaScript.

2) In survey.pstpl, change:
<td width="30%"valign="middle" align="left"><img src="{TEMPLATEURL}Workload_Logo_klein.png" alt="Logo Image" /></td>
To:
<td class="logoImage" width="30%"valign="middle" align="left"><img src="{TEMPLATEURL}Workload_Logo_klein.png" alt="Logo Image" /></td>

3) Add the following script to the source of the special question. Modify it with the correct path to the new logo image.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function(){
 
		$('.logoImage img').attr('src', 'upload/templates/yourTemplate/new_logo.png');;
 
	});
 
</script>
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: Change css/style within a survey ? 2 years 9 months ago #66293

  • muellers
  • muellers's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Karma: 0
Thank you very much! Works fine!
The administrator has disabled public write access.

Re: Change css/style within a survey ? 2 years 9 months ago #66297

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5300
  • Thank you received: 291
  • Karma: 247
You're welcome!

If our hints have been helpful and you enjoy limesurvey please consider a donation to the team .
We do all this in our free time and you don't have to pay a penny for this software.

Without your help we can't keep this project alive.

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.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.240 seconds
Donation Image