Themen
 
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:

Typoscript-Setup:
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:

Typoscript-Setup:
lib.footerText = HTML
lib.footerText.value = Example Gmbh - Example Straße 1 - 12345 Testhausen - Mail: <a href="mailto:office@example.com">office@example.com</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.
Typoscript-Setup:
lib.footerText = TEXT
lib.footerText.value = Example Gmbh - Example Straße 1 - 12345 Testhausen - <LINK office@example.com>office@example.com</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 office@example.com zu generieren reicht wird also

<LINK office@examle.com>...</LINK>

geschrieben. TYPO3 setzt das dann bei der Ausgabe autoatisch in

<a href="javascript:linkTo_UnCryptMailto('nbjmup+pggjdfAfybnqmf/dpn');" >office(at)example.com</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).



Kommentare


Kommentar schreiben...


Anzeige: 397 - 447 von 447.
 
Thursday, 17. 09 15 14:33
http://onlinepassforgames http://onlinepassforgames.com/Autocarinsure.php
aus g47ecor9 ypr5un15di2@mail.com    Website   

Why do I bother calling up people when I can just read this!

 
Thursday, 17. 09 15 13:52
http://shearessentials.co http://shearessentials.com/bestratesforautoinsuranceinarizona.php
aus EJU8I5t9 lmgied7fi@outlook.com    Website   

The accident of finding this post has brightened my day

 
Thursday, 17. 09 15 12:35
http://onlinepassforgames http://onlinepassforgames.com/auto-insurance-companies-minneapolis-mn.php
aus nKafBBcfC 1gyvji0w@yahoo.com    Website   

So that's the case? Quite a revelation that is.

 
Thursday, 17. 09 15 11:26
http://beyondgoodintentio http://beyondgoodintentions.org/auto-insurance-oregon-quotes.php
aus LeUAgoBEq4 zmcio5h3bc@hotmail.com    Website   

I think you hit a bullseye there fellas!

 
Thursday, 17. 09 15 09:18
http://expeditiontravelco http://expeditiontravelco.com/auto_insurance_battle_creek.php
aus FKMOHyl0rRdi jc32htk1pp@yahoo.com    Website   

You're on top of the game. Thanks for sharing.

 
Thursday, 17. 09 15 08:26
http://allenbaron.com/che http://allenbaron.com/cheapautoinsurancetexasquotes.php
aus eAcWesLJ oa8dp0ivb7h@outlook.com    Website   

I wanted to spend a minute to thank you for this.

 
Thursday, 17. 09 15 07:36
http://beautifywithgranit http://beautifywithgranite.com/state_insurance_company_com.php
aus y2GrCc1Xf 31k0yucu@hotmail.com    Website   

I am totally wowed and prepared to take the next step now.

 
Thursday, 17. 09 15 06:38
http://priority-med.com/c http://priority-med.com/cheapautoinsuranceorlandofl.php
aus AT5Pe6Rz b197w8d3c@hotmail.com    Website   

Unparalleled accuracy, unequivocal clarity, and undeniable importance!

 
Thursday, 17. 09 15 05:21
http://allenbaron.com/fas http://allenbaron.com/fast_free_auto_insurance_quotes.php
aus GnHUzoNbfs npl3mslc@outlook.com    Website   

What an awesome way to explain this-now I know everything!

 
Thursday, 17. 09 15 03:41
http://onlinepassforgames http://onlinepassforgames.com/cheap_insurance_ca.php
aus 5vBykARVoBQ tbl9fl18fff@mail.com    Website   

I was really confused, and this answered all my questions.

 
Thursday, 17. 09 15 01:40
http://onlinepassforgames http://onlinepassforgames.com/car-insurance-m-s-vouchers.php
aus 3Ox9Uxup qpr2sr5qmba@gmail.com    Website   

Thinking like that shows an expert's touch

 
Wednesday, 16. 09 15 23:29
http://allenbaron.com/aut http://allenbaron.com/auto-insurance-companies-in-charlotte-nc.php
aus LjgoGUB4dZtx wutnue13@gmail.com    Website   

Your article perfectly shows what I needed to know, thanks!

 
Wednesday, 16. 09 15 22:22
http://prospect-clothing. http://prospect-clothing.com/statefarminsuranceorlandofl.php
aus 8ZPmcH380Q f2nseb53@hotmail.com    Website   

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

 
Wednesday, 16. 09 15 21:37
http://thelicensetochill. http://thelicensetochill.com/Need-Cheap-Full-Coverage-Auto-Insurance-Effective-Today.php
aus kGHsy8VS2v d2rgwfvncz@yahoo.com    Website   

Great article, thank you again for writing.

 
Wednesday, 16. 09 15 19:41
http://sellingstockton.co http://sellingstockton.com/wawanesaautoinsurancequote.php
aus xtmPZ1yq7 5h327rzd@gmail.com    Website   

Thanks for starting the ball rolling with this insight.

 
Wednesday, 16. 09 15 18:39
http://allenbaron.com/sho http://allenbaron.com/shouldyougetinsuranceonarentalcar.php
aus odWVJRkXFiX6 sb3o1k4mso9@mail.com    Website   

Information is power and now I'm a !@#$ing dictator.

 
Wednesday, 16. 09 15 15:45
http://refugeloveministry http://refugeloveministry.org/21stcenturyinsurancenewcarreplacement.php
aus RHxsmZdu o2kiydr6r@outlook.com    Website   

Yeah that's what I'm talking about baby--nice work!

 
Wednesday, 16. 09 15 14:55
http://mybosniaherzegovin http://mybosniaherzegovina.net/FullCoverageCarInsuranceGa.php
aus j7ghIgIQrR nb3xgcchc@yahoo.com    Website   

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

 
Wednesday, 16. 09 15 13:36
http://thelittleperchcomp http://thelittleperchcompany.com/carinsurancecaliforniacalculator.php
aus nFnFpIz26 fxd0vw3n@yahoo.com    Website   

Keep on writing and chugging away!

 
Wednesday, 16. 09 15 11:35
http://prospect-clothing. http://prospect-clothing.com/tenant_insurance_the_cooperators.php
aus y3BPbSwp a5lv3kjesn@hotmail.com    Website   

I cannot tell a lie, that really helped.

 
Wednesday, 16. 09 15 10:30
http://mybosniaherzegovin http://mybosniaherzegovina.net/California_Low_Income_Car_Insurance.php
aus HrNe49mpCEk wwwv0r7rc@mail.com    Website   

My problem was a wall until I read this, then I smashed it.

 
Wednesday, 16. 09 15 08:46
http://allenbaron.com/aut http://allenbaron.com/autoinsurancehistory.php
aus rYQp6OOH x5gte0ws84n@outlook.com    Website   

With the bases loaded you struck us out with that answer!

 
Wednesday, 16. 09 15 07:23
http://shearessentials.co http://shearessentials.com/cheapautoinsuranceinelpasotexas.php
aus mYWECCfl9uUH gn76hgl2te@outlook.com    Website   

People normally pay me for this and you are giving it away!

 
Wednesday, 16. 09 15 06:39
http://beyondgoodintentio http://beyondgoodintentions.org/cheapmalpracticeinsuranceforlpn.php
aus I3q6q564z t3ql57ca@outlook.com    Website   

Gee whiz, and I thought this would be hard to find out.

 
Wednesday, 16. 09 15 05:45
http://refugeloveministry http://refugeloveministry.org/cheap-car-insurance-for-students-in-ontario.php
aus gFhVLvLQ7axH 23vbebns3d@gmail.com    Website   

There's nothing like the relief of finding what you're looking for.

 
Wednesday, 16. 09 15 03:27
http://allenbaron.com/aut http://allenbaron.com/autoinsurancenjquotes.php
aus tbiFWFtkkunV 7773d379@mail.com    Website   

I don't even know what to say, this made things so much easier!

 
Wednesday, 16. 09 15 01:25
http://sellingstockton.co http://sellingstockton.com/auto_insurance_denver_co.php
aus SlBu3G2Ps7z bttyukbi@mail.com    Website   

That insight would have saved us a lot of effort early on.

 
Wednesday, 16. 09 15 00:46
http://allenbaron.com/aut http://allenbaron.com/autoinsurancearkansas.php
aus bg60Qr3Hc fwhfzheh2@outlook.com    Website   

Hey, killer job on that one you guys!

 
Tuesday, 15. 09 15 23:32
http://onlinepassforgames http://onlinepassforgames.com/cheap_commercial_pickup_insurance.php
aus ejlu4Fgx wuwo8lpwd@outlook.com    Website   

Finding this post. It's just a big piece of luck for me.

 
Tuesday, 15. 09 15 22:45
http://mybosniaherzegovin http://mybosniaherzegovina.net/Auto-Insurance-Raleigh-Nc.php
aus ABY6j4Ce5 nsydo1idc8@gmail.com    Website   

This is just the perfect answer for all of us

 
Tuesday, 15. 09 15 20:32
http://priority-med.com/n http://priority-med.com/nodeductiblecarinsurance.php
aus Y8jcd7AzBj4y 5vvksx4kr@outlook.com    Website   

Furrealz? That's marvelously good to know.

 
Tuesday, 15. 09 15 19:52
http://hellosamrawson.com http://hellosamrawson.com/cheap-insurance-chicago.php
aus hy22LATT nkjzfwxl2t@outlook.com    Website   

It's good to see someone thinking it through.

 
Tuesday, 15. 09 15 17:34
http://refugeloveministry http://refugeloveministry.org/cheapestcartorunoninsurance.php
aus VEK0ULu7bF 4ggvwhkweng@yahoo.com    Website   

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

 
Tuesday, 15. 09 15 16:41
http://shearessentials.co http://shearessentials.com/insurance-for-cars-in-texas.php
aus iwrEmgnc5JT yfpifyxuj7@hotmail.com    Website   

At last! Something clear I can understand. Thanks!

 
Tuesday, 15. 09 15 10:30
http://hellosamrawson.com http://hellosamrawson.com/cheap-health-insurance-washington-state.php
aus lvPKJgWmB1jw usbc6jvi@outlook.com    Website   

This is the perfect way to break down this information.

 
Tuesday, 15. 09 15 07:16
http://thelicensetochill. http://thelicensetochill.com/AmericanAutoInsuranceCompany.php
aus OandzGDNtwL0 5d2zr1qi@mail.com    Website   

That's a sensible answer to a challenging question

 
Tuesday, 15. 09 15 06:24
http://beyondgoodintentio http://beyondgoodintentions.org/autoownersinsurancedouglasvillega.php
aus 6oNm0Fe2L ber34dm96e@outlook.com    Website   

Finally! This is just what I was looking for.

 
Tuesday, 15. 09 15 05:34
http://hellosamrawson.com http://hellosamrawson.com/carinsurancerateillinois.php
aus vxwHQFiJ43V egn1llenph6@mail.com    Website   

Time to face the music armed with this great information.

 
Monday, 14. 09 15 17:21
http://expeditiontravelco http://expeditiontravelco.com/cheap_car_insurance_chula_vista_ca.php
aus nzbC1W5kmi 1al6igmi@gmail.com    Website   

What's it take to become a sublime expounder of prose like yourself?

 
Friday, 11. 09 15 04:47
http://cigarboxslim.com/c http://cigarboxslim.com/cheap_insurance_sites_for_young_drivers.html
aus d6NZzn3ZYgL tkvq3tsd@gmail.com    Website   

BS low - rationality high! Really good answer!

 
Friday, 11. 09 15 03:46
http://infoworks-ny.com/c http://infoworks-ny.com/cheap_private_health_insurance_nj.html
aus rgGmu6oT9OZh i2hjj4sw@hotmail.com    Website   

It's always a relief when someone with obvious expertise answers. Thanks!

 
Friday, 11. 09 15 02:22
http://debpnigerians.com/ http://debpnigerians.com/cheap_car_insurance_in_angleton_tx.html
aus sJUEuJJ0R nqg5q9vgp@mail.com    Website   

I had no idea how to approach this before-now I'm locked and loaded.

 
Friday, 11. 09 15 01:48
http://artistic-orgonite. http://artistic-orgonite.com/progressive-auto-insurance-pros-cons.html
aus EGUbUkRStJ ohth110oqrr@mail.com    Website   

Knowledge wants to be free, just like these articles!

 
Thursday, 10. 09 15 21:28
http://thebrianrodriguez. http://thebrianrodriguez.com/aami-quote-comprehensive-car-insurance.html
aus b2l0MbaLv iu02i11v41@mail.com    Website   

Now we know who the sensible one is here. Great post!

 
Thursday, 10. 09 15 20:35
http://debpnigerians.com/ http://debpnigerians.com/cheapcarinsurancequotesinmichiganl.html
aus gAJFqYjDI sie9g44z@gmail.com    Website   

You saved me a lot of hassle just now.

 
Thursday, 10. 09 15 16:17
http://infoworks-ny.com/b http://infoworks-ny.com/bestjobforcheapcarinsurance.html
aus gyZYAyXVpm5 4zck4pxnto@hotmail.com    Website   

This piece was a lifejacket that saved me from drowning.

 
Thursday, 10. 09 15 15:30
http://cheungskeemenshirt http://cheungskeemenshirt.com/aarp_auto_home_insurance_reviews.html
aus Vm4BOq6X0Zyp 3sgdtpk9my@hotmail.com    Website   

Kudos! What a neat way of thinking about it.

 
Thursday, 10. 09 15 14:18
http://classicconeygrill. http://classicconeygrill.com/averagepriceforcarinsuranceinnewyork.html
aus kAMneLYQS0 6xxoo7bos@outlook.com    Website   

Your post is a timely contribution to the debate

 
Thursday, 10. 09 15 13:35
http://cheungskeemenshirt http://cheungskeemenshirt.com/the_dominion_auto_insurance_quote.html
aus zjWY5Kcfo p1milvbd0ei@mail.com    Website   

Of the panoply of website I've pored over this has the most veracity.

 
Thursday, 10. 09 15 09:36
http://therapiststogether http://therapiststogether.com/does_my_car_insurance_cover_me_to_drive_other_cars.html
aus A6JFB3KZgDd uybheftgdsf@mail.com    Website   

There's a terrific amount of knowledge in this article!

 
Wednesday, 09. 09 15 12:51
Blake Blake
aus 9advwgj8Ku iyu608lkbul@gmail.com    Website   

Do you remember when Spongebob first aired in '99. The Spongebob first 3 seanoss were great. The old spongebob episodes from 1999-2004 are great. The new Spongebob episodes from 2007-present are not are funny as the earlier episodes from '99.The Spongebob episodes from '99 were the best. 1999 Spongebob is a masterpiece, not the new episode that we had lately.Do you agree with me that the old Spongebob episodes are better than the new episodes.

 
 

Kommentar schreiben