Individuelles Webdesign
11.12.2009 22:50

Code-Schnipsel: Mail-Links in Typoscript-TEXT-Elementen schützen

Kategorie: Typo3, Tutorial, Typoscript
Von: Andreas Prucha
Im Editor eingegebene e-mail-Adressen werden von TYPO3 automatisch "verschlüsselt". Nicht so jedoch bei im TypoScript erstellten Text-Elementen. Das lässt sich ändern.


TYPO3 hilft e-mail-Adressen vor Spammern zu schützen, indem es im Backend-Editor eingegebene mailto-links automatisch mit Javascript verschlüsselt.

Dafür ist folgende Einstellung verantwortlich:

config.spamProtectEmailAddresses = 1

Manchmal ist es aber auch notwendig Textelemente im Typoscript zu erstellen. Beispielsweise um einen Footer-Text für das Template zu erstellen:

lib.footerText = HTML
lib.footerText.value = Example Gmbh - Example Straße 1 - 12345 Testhausen - Mail: <a href=""></a>

Einziges Problem dabei: Die e-mail-Adresse bleibt bei der Ausgabe dann ungeschützt, unabhängig von config.spamProtectEmailAddresses.

TYPO3 lässt sich aber überreden den Inhalt zu parsen und die e-mail-adresse entsprechend den Einstellungen zu schützen. Dafür sind folgende kleine Änderungen notwendig:

  1. Das Element muss als TEXT definiert werden, nicht HTML (keine Ahnung warum - mit HTML hat es nicht funktioniert und ich habe mich dann auch nicht weiter damit beschäftigt warum)
  2. Es darf nicht der Tag a verwendet werden, sondern der interne TYPO3-Tag LINK
  3. und es muss lib.parseFunc als parser-Funktion angegeben werden.
lib.footerText = TEXT
lib.footerText.value = Example Gmbh - Example Straße 1 - 12345 Testhausen - <LINK></LINK>
lib.footerText.parseFunc < lib.parseFunc

In der ersten Zeile wird das Element als TEXT definiert. In der Definition des Strings wird nicht der HTML-Tag a verwendet, sondern der TYPO3-Tag LINK. LINK wird wie folgt verwendet:

<LINK {mail|url|pid}>

Um einen Mailto-Link für zu generieren reicht wird also


geschrieben. TYPO3 setzt das dann bei der Ausgabe autoatisch in

<a href="javascript:linkTo_UnCryptMailto('nbjmup+pggjdfAfybnqmf/dpn');" >office(at)</a>

um und schützt damit die Adresse weitgehend vor Adressdieben und Spammern.

Damit das allerdings auch wirklich passiert muss der Text durch die ParseFunc gejagt werden. Dafür wird die Standard-ParseFunc verwendet, die TYPO3 auch für die anderen Content-Elemente benutzt: lib.parseFunc


Tipp: Der LINK-Tag lässt sich auch für die Verlinkung von Seiten benutzen. Dafür muss nur die Page-ID angegeben werden.
<LINK 57>Impressum</LINK>
generiert einen entsprechenden Link zu Seite 57 (beispielsweise das Impressum).


Kommentar schreiben...

Anzeige: 298 - 396 von 459.
Friday, 27. 11 15 15:46
aus uvqpS6elv    Website   

Glad I've finally found something I agree with!

Friday, 27. 11 15 04:23
aus OPT16M4L    Website   

Way to go on this essay, helped a ton.

Thursday, 26. 11 15 18:10
aus GoVkrG6rT    Website   

I can't believe I've been going for years without knowing that.

Thursday, 26. 11 15 15:41
aus Cv3ksoOziMT7    Website   

Ah yes, nicely put, everyone.

Thursday, 26. 11 15 03:39
aus JMJZC4ghqFn    Website   

This forum needed shaking up and you've just done that. Great post!

Thursday, 26. 11 15 02:45
aus L9j5MbwC9mXP    Website   

I appreciate you taking to time to contribute That's very helpful.

Wednesday, 25. 11 15 22:38
aus AITzeXeeobBI    Website   

Good to see real expertise on display. Your contribution is most welcome.

Wednesday, 25. 11 15 09:27
aus aguFQuQvMDAu    Website   

Cool! That's a clever way of looking at it!

Wednesday, 25. 11 15 03:42
aus 4U76SBL4C    Website   

Articles like this make life so much simpler.

Tuesday, 24. 11 15 20:26
aus cu1HNJqq9sY    Website   

The ability to think like that shows you're an expert

Tuesday, 24. 11 15 20:24
aus CKFeAucouNy    Website   

Why does this have to be the ONLY reliable source? Oh well, gj!

Tuesday, 24. 11 15 07:56
aus FDgiCzpXJC    Website   

Holy shiznit, this is so cool thank you.

Tuesday, 24. 11 15 06:29
aus Mm8qgoPHsrZ    Website   

Boy that really helps me the heck out.

Tuesday, 24. 11 15 02:18
aus BpYGWzVUyHBG    Website   

Thanks for the great info dog I owe you biggity.

Sunday, 22. 11 15 22:27
Alexsis Alexsis
aus CanhZ9u52    Website   

I just clicked over from anhoetr site and figured I should take a look around. Like what I see so now I'm following you. Look forward to checking out your some of your posts again.[]

Sunday, 22. 11 15 22:07
Sebastian Sebastian
aus 6t2HIB4zLSD9    Website   

I've made a decision to itnicador this :D wish your internet site get some wonderful support! this is recognized as a throughout the world problem that is certainly just concealed as properly as when its brought to your community eyesight people today just work like it does not exist! We require a great deal more zero bullying consciousness rallies or some thing :D[]

Sunday, 22. 11 15 22:01
Manuel Manuel
aus wzQgYMUdN    Website   

Unicorn lair 'discovered' in North KoreaKorean news agency say they have 'recently reerifnomcd' the lair of one of the unicorns ridden by the ancient King Tongmyong. 皇室と北朝鮮 そうですか そうですか

Sunday, 22. 11 15 21:30
Ahmed Ahmed
aus M1r78zn9yU9    Website   

Oh my goodness! Amazing artlcie dude! Many thanks, However I am having problems with your RSS. I don’t understand why I cannot join it. Is there anybody getting identical RSS problems? Anyone that knows the solution can you kindly respond? Thanks!!

Sunday, 22. 11 15 21:24
Sukh Sukh
aus JwBUdIFjgxN    Website   

A lot of thanks for all of the work on this weibste. Betty takes pleasure in participating in internet research and it is simple to grasp why. I know all regarding the compelling ways you give informative guidance via this blog and even cause contribution from others on this content plus our favorite girl has always been starting to learn a lot. Take advantage of the remaining portion of the year. You are always performing a useful job.

Friday, 20. 11 15 17:25
aus HtulvEnmrh    Website   

Cheers pal. I do appreciate the writing.

Friday, 20. 11 15 14:58
aus YnTWjq5Li0    Website   

Finding this post solves a problem for me. Thanks!

Thursday, 19. 11 15 22:34
aus PIfVWQGY6Zme    Website   

Finally! This is just what I was looking for.

Thursday, 19. 11 15 01:45
aus OSRnNEL8k    Website   

You've got it in one. Couldn't have put it better.

Wednesday, 18. 11 15 17:43
aus U7n7oyVp2zI    Website   

You've got to be kidding me-it's so transparently clear now!

Wednesday, 18. 11 15 01:42
aus DFI4urPubn    Website   

Created the greatest articles, you have.

Tuesday, 17. 11 15 17:38
aus QIx4scxlHh    Website   

This shows real expertise. Thanks for the answer.

Tuesday, 17. 11 15 03:44
aus vhkBRLEr    Website   

Last one to utilize this is a rotten egg!

Monday, 16. 11 15 18:33
aus zJysrhquM9z    Website   

Thinking like that is really amazing

Monday, 16. 11 15 18:20
aus lNxdHFZ7SvrM    Website   

Weeeee, what a quick and easy solution.

Sunday, 15. 11 15 10:49
aus lzEMl2kchD    Website   

Well I guess I don't have to spend the weekend figuring this one out!

Sunday, 15. 11 15 01:13
aus ED6bIcHgvs    Website   

Check that off the list of things I was confused about.

Saturday, 14. 11 15 09:14
aus EwXULUM83    Website   

Posts like this make the internet such a treasure trove

Saturday, 14. 11 15 07:53
aus PNrgoCQx    Website   

Thank God! Someone with brains speaks!

Friday, 13. 11 15 15:04
aus gV0wYZgvH    Website   

Knocked my socks off with knowledge!

Friday, 13. 11 15 11:19
aus VZBE12SW    Website   

I'm shocked that I found this info so easily.

Thursday, 12. 11 15 22:53
aus 9ccEwRwQ7    Website   

It's a pleasure to find someone who can think so clearly

Thursday, 12. 11 15 11:58
aus iDgJxOts6    Website   

This article keeps it real, no doubt.

Wednesday, 11. 11 15 14:59
aus 1tNZ5zoY8    Website   

Gosh, I wish I would have had that information earlier!

Tuesday, 10. 11 15 11:45
auto insurance auto insurance
aus bJdgtIT63    Website   

Articles like these put the consumer in the driver seat-very important.

Monday, 09. 11 15 15:58
aus ltTMXcSEx    Website   

You mean I don't have to pay for expert advice like this anymore?!

Monday, 09. 11 15 09:48
aus AbAY7nTNxAu    Website   

Pleasing you should think of something like that

Monday, 09. 11 15 08:31
aus aeebZqGHzeZ6    Website   

Thanks guys, I just about lost it looking for this.

Monday, 09. 11 15 02:40
aus rn8vJBPXEAin    Website   

I can't hear anything over the sound of how awesome this article is.

Saturday, 07. 11 15 17:51
aus II33ko5c    Website   

Essays like this are so important to broadening people's horizons.

Saturday, 07. 11 15 15:51
aus HsuFHyDSyiog    Website   

Boom shakalaka boom boom, problem solved.

Saturday, 07. 11 15 02:25
aus Oktys1Lw    Website   

The purchases I make are entirely based on these articles.

Friday, 06. 11 15 14:34
aus PocGYylXLPp    Website   

You really found a way to make this whole process easier.

Thursday, 05. 11 15 03:05
aus xB9ZDAuVQYBN    Website   

Good to find an expert who knows what he's talking about!

Wednesday, 04. 11 15 13:23
aus hKjLFHwR    Website   

Glad I've finally found something I agree with!

Tuesday, 03. 11 15 01:41
aus 6wqs13I6    Website   

What I find so interesting is you could never find this anywhere else.

Monday, 02. 11 15 05:35
aus agKFdMoOF    Website   

It's great to find someone so on the ball

Saturday, 31. 10 15 22:56
aus st7H780Y5JUr    Website   

I didn't know where to find this info then kaboom it was here.

Saturday, 31. 10 15 12:15
aus ESrcUO2VpYG    Website   

All of my questions settled-thanks!

Friday, 30. 10 15 15:54
aus rjsNmsWh5xx    Website   

I'm not easily impressed but you've done it with that posting.

Thursday, 29. 10 15 16:11
aus HN6trYyK4p9u    Website   

I feel satisfied after reading that one.

Wednesday, 28. 10 15 12:00
aus LiwbW0uF    Website   

At last, someone comes up with the "right" answer!

Tuesday, 27. 10 15 18:09
aus oNAlcWG17AF    Website   

A perfect reply! Thanks for taking the trouble.

Tuesday, 27. 10 15 13:53
aus 7SmUAImsuRm    Website   

In the complicated world we live in, it's good to find simple solutions.

Tuesday, 27. 10 15 03:24
aus SfNzErYH    Website   

Just do me a favor and keep writing such trenchant analyses, OK?

Saturday, 24. 10 15 06:55
aus MEBOnwdx    Website   

I found just what I was needed, and it was entertaining!

Friday, 23. 10 15 09:25
aus 1XvFJ92nday    Website   

This could not possibly have been more helpful!

Friday, 23. 10 15 03:09
aus VOKMZZyE    Website   

Never would have thunk I would find this so indispensable.

Friday, 23. 10 15 01:03
aus x0hGIPhV    Website   

Shoot, who would have thought that it was that easy?

Wednesday, 21. 10 15 14:08
aus uxLu6G7Pc3    Website   

Yeah, that's the ticket, sir or ma'am

Tuesday, 20. 10 15 10:38
aus 9P7I5Kp0v    Website   

That's a skillful answer to a difficult question

Sunday, 18. 10 15 17:44
aus ojlv0ii8    Website   

I really appreciate free, succinct, reliable data like this.

Saturday, 17. 10 15 17:44
aus 2HNMxg5XeFz    Website   

None can doubt the veracity of this article.

Friday, 16. 10 15 21:08
aus VNeloIO5CU    Website   

I just hope whoever writes these keeps writing more!

Thursday, 15. 10 15 22:19
aus 21ihDjtzyhd    Website   

Gosh, I wish I would have had that information earlier!

Thursday, 15. 10 15 09:34
aus eqTLLjG23    Website   

I might be beating a dead horse, but thank you for posting this!

Wednesday, 14. 10 15 20:11
aus 5rgrOR3ju    Website   

Stay with this guys, you're helping a lot of people.

Tuesday, 13. 10 15 06:12
aus fBqEwF7wFh    Website   

Thanks for introducing a little rationality into this debate.

Wednesday, 07. 10 15 10:26
aus gBUfq2hWVg    Website   

Hey, that's the greatest! So with ll this brain power AWHFY?

Tuesday, 06. 10 15 06:39
aus epGqjF08Q    Website   

You've really captured all the essentials in this subject area, haven't you?

Sunday, 27. 09 15 07:36
aus gtwkACx58f    Website   

Right on-this helped me sort things right out.

Sunday, 27. 09 15 05:19
aus iqvw2BiXZTz2    Website   

I thought I'd have to read a book for a discovery like this!

Sunday, 27. 09 15 03:07
aus d68iqexPW55N    Website   

One or two to remember, that is.

Sunday, 27. 09 15 00:08
aus BQTnZoZdNlI    Website   

Way to use the internet to help people solve problems!

Saturday, 26. 09 15 09:11
aus uRgXGaudZ    Website   

At last some rationality in our little debate.

Friday, 25. 09 15 10:41
aus ZZJyLIOMKgo    Website   

An answer from an expert! Thanks for contributing.

Thursday, 24. 09 15 18:28
aus zngtEdPJ8b9    Website   

At last! Something clear I can understand. Thanks!

Thursday, 24. 09 15 18:04
aus z206VwTu    Website   

I came, I read this article, I conquered.

Thursday, 24. 09 15 01:59
aus OlclmqGsRH    Website   

I feel so much happier now I understand all this. Thanks!

Thursday, 24. 09 15 01:45
aus kARyxZXt5PiM    Website   

It's great to find an expert who can explain things so well

Wednesday, 23. 09 15 14:53
aus 4hpUdKum3f    Website   

Son of a gun, this is so helpful!

Wednesday, 23. 09 15 14:36
aus NusBNYmkapP    Website   

A good many valuables you've given me.

Wednesday, 23. 09 15 08:50
aus ravzYKpB    Website   

That kind of thinking shows you're on top of your game

Wednesday, 23. 09 15 08:09
aus UHu84Gaq8L    Website   

Your post is a timely contribution to the debate

Monday, 21. 09 15 10:27
aus KM3xbuRc9AdC    Website   

A million thanks for posting this information.

Monday, 21. 09 15 06:43
aus sFNNmms2SEYo    Website   

A good many valuables you've given me.

Monday, 21. 09 15 03:06
aus koXNFs9QCld    Website   

Too many compliments too little space, thanks!

Sunday, 20. 09 15 15:05
aus hgqwhdx9    Website   

We could've done with that insight early on.

Sunday, 20. 09 15 10:40
aus Zq6mZK4ntTy    Website   

This information is off the hizool!

Sunday, 20. 09 15 06:56
aus tonNYknWhZm    Website   

It's good to see someone thinking it through.

Saturday, 19. 09 15 18:23
aus PeXUI5JQBtxq    Website   

Hey, that's powerful. Thanks for the news.

Saturday, 19. 09 15 14:54
aus z7SbxJ6IMwZN    Website   

If you want to get read, this is how you should write.

Friday, 18. 09 15 23:21
aus sppZEnFN1UZ    Website   

Which came first, the problem or the solution? Luckily it doesn't matter.

Friday, 18. 09 15 19:11
aus CR2OZkKf    Website   

Stay informative, San Diego, yeah boy!

Friday, 18. 09 15 13:46
aus 5woYMZhbi8n    Website   

Superb information here, ol'e chap; keep burning the midnight oil.


Kommentar schreiben