Thank you, however I still have a script error when taking this approach:
My code is (using v8 beta, "Kunde" is the merged field):
[% Begin Unverified Perl
my $a=VALUE("Kunde");
if($a eq 'Real')
{
return '<img src=\"\[%GraphicsPath()%\]Real.png\" alt=\"\" border=\"0\">';
}
else
{
return 'Kunde ist nicht REAL';
}
End Unverified %]
If I enter a password where "Kunde" is not "Real" it works. But it works not when "Kunde"="Real", so the error is with the returned image.
However, to check, I entered this in the footer of the same question and the image shows up.
<img src="[%GraphicsPath()%]Real.png" alt="" border="0">
hmm, I don't have v8 installed on this machine and don't have the time to install it to be honest. if you'd like to pursue this method, enter as a respondent whose "Kunde" is not "Real" and on this specific page, "view source" in browser and paste the outcoming HTML source code into http://pastebin.com/ and link here so we can try to see what's wrong.
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
[captcha placeholder]
To avoid this verification in future, please log in or register.
0 votes
I have successfully done this in the past (both company logo in the header and helpdesk email addresses in the footer) by using lists. Just create the parent list as usual with the logos as the members, and then create a conditional list based on your merged info. Then just reference the conditional list in your global header.
I thought it doesn't like the "[%" or "%]" in the <jobname>login.html file?
Hi Marion, that sounds interesting. Could you please provide an example of how to "create a conditional list based on your merged info. Then just reference the conditional list in your global header."
Many thanks, Thomas
1. Create a parent list. For example, a list called LOGOS. The members would reference the graphics folder like this: <img src="[%GraphicsPath()%]Logo 1.jpg" alt="" border="0">. You will have as many list members as you have logos to show.
2. Create a conditional list. For instance, LOGOshow. When I did this, I had a merged field in the sample called "Brand". I made this a numeric field. My conditional list, then, used basic SSI script - ADD(Logos,Brand). Since the field "brand' was numeric, it populated the conditional list with the correct logo.
3. In the global header, I added the SSI script: [%listlabel(LOGOshow,1)%]
This works just fine as long as you use the "one click" method of entry for respondents - so not through the login.html page. Once the code picks up on the merged field, all is good. If you DO need to allow folk to enter using the generic login page, you WILL need to do as Mr Moon has said and add the code to each and every page. I would still choose to just put the listlabel on there though - heaps easier and less error-prone. And if your client asks for a change, it's just one change in one place.
Thank you Marion, that is really nice!
Hi Marion, many thanks again. Just in case you're interested: I figured out another approach that is also working without the "on-click" method. I pasted this code in the header section of the survey settings:
[% Begin Unverified Perl
my $a=VALUE("Company");
$a =~ s/\s+//;
return '<img src=' . GRAPHICSPATH() . $a . '.png border=\"0\">';
End Unverified %]
"Company" is the merged in field, that is then stripped of any blanks. Then a graphic with that name is displayed as logo on all survey pages. If there is no corresponding logo, nothing is displayed.
Your comment on this answer:
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
[captcha placeholder]
To avoid this verification in future, please log in or register.
My code is (using v8 beta, "Kunde" is the merged field):
[% Begin Unverified Perl
my $a=VALUE("Kunde");
if($a eq 'Real')
{
return '<img src=\"\[%GraphicsPath()%\]Real.png\" alt=\"\" border=\"0\">';
}
else
{
return 'Kunde ist nicht REAL';
}
End Unverified %]
If I enter a password where "Kunde" is not "Real" it works. But it works not when "Kunde"="Real", so the error is with the returned image.
However, to check, I entered this in the footer of the same question and the image shows up.
<img src="[%GraphicsPath()%]Real.png" alt="" border="0">