|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Eistee Smarty Rookie
Joined: 18 Jun 2004 Posts: 10
|
Posted: Wed Jun 23, 2004 6:33 pm Post subject: Probleme mit {mailto} |
|
|
Hi,
ich habe ein Problem mit der {mailto}-Funktion von smarty.
Mein Code sieht wie folgt aus:
Code: |
{mailto address="$row.mail" text="<img src=templates/images/mail.gif border=0 hspace=1>"}
|
Nun läuft bei der Ausgabe aber irgendwas falsch.
Anstelle der korrekten Adresse steht folgendes im Sourcecode:
Quote: |
<a href="mailto:Array.mail" ><img src=templates/images/mail.gif border=0 hspace=1></a>
|
Wenn ich nun aber einfach nur {$row.mail} in das Template schreibe, so wird die richtige mail-Adresse ausgegeben.
Wo liegt der Fehler? |
|
Back to top |
|
Duncan Smarty Pro
Joined: 16 Dec 2003 Posts: 166
|
Posted: Wed Jun 23, 2004 6:54 pm Post subject: Re: Probleme mit {mailto} |
|
|
Eistee wrote: | Wo liegt der Fehler? |
In address="$row.mail" welches als Wert.mail ausgegeben wird wenn es in "" gesetzt wird.
Du musst entweder address=$row.mail benutzen, oder den Wert einer neuen Variable mittels assign hinzufuegen e.g.: {assign var=foo value=$row.mail} , so dass Du dann address="$foo" benutzen kannst. |
|
Back to top |
|
Eistee Smarty Rookie
Joined: 18 Jun 2004 Posts: 10
|
Posted: Wed Jun 23, 2004 9:39 pm Post subject: |
|
|
Danke für deine Antwort
Hab das Problem jetzt über {... address=$row.mail ...} gelöst.
Eine Frage hab ich allerdings noch.
Wenn ich jetzt noch encode="hex" in die mailto-Funktion schreibe, wird zwar die email-Adresse in hex umgewandelt, allerdings auch der HTML-Code für den Button.
Lässt sich das vielleicht irgendwie umgehen? |
|
Back to top |
|
Eistee Smarty Rookie
Joined: 18 Jun 2004 Posts: 10
|
Posted: Thu Jun 24, 2004 8:45 am Post subject: |
|
|
Hab's grda nochmal mit encode="javascript" probiert - das funktioniert.
Handelt es sich hierbei evtl. um einen Bug in der mailto-Funktion... |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Jun 24, 2004 11:08 am Post subject: |
|
|
zu deiner ersten frage: lass die " weg:
Code: | {mailto address=$row.mail text="<img src=templates/images/mail.gif border=0 hspace=1>"} |
wird funktionieren. ansonsten siehe:
http://smarty.php.net/manual/de/language.syntax.quotes.php
Eistee wrote: | Handelt es sich hierbei evtl. um einen Bug in der mailto-Funktion... |
nö. du benutzt mailto mit encode=hex einfach für etwas für das es nicht gedacht ist.
das text-attribute darf halt nur text sein und kein html. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|