Zum Inhalt springen

zum Tausendsten: externe Links in neuem Fenster öffnen

Erstellt am 11. Juli 2005 · 4 Antworten · letzte Antwort am 22. Juli 2005

Tags: Links, Frage

Amelia ·
styles.content.links.extTarget = _blank

--> Damit öffne ich doch externe Links in einem neuen Fenster, richtig!? Wieso tut er das bei mir nicht ???
Habe genau das in meinem Maintemplate in den Constanten zu stehen... *gggrrr*

salvi ·

hi

ich hab's so gelöst:

1. php script:

<?php
class user_typolink_class {
var $cObj; // reference to the calling object.
function main($content,$conf) {
if ($content["TYPE"] == "file"){
$content["targetParams"] = ' target="_blank"';
}
$TAG = '<a href="'.$content[" urlcontenttargetparamscontentatagparams="">';
return $TAG;
}
}
?>

2. TS code in Setup part:

includeLibs.user_typolink = fileadmin/scripts/user_typolink.php

tt_content.text.20.parseFunc.tags {
      link = TEXT
      link {
        current = 1
        typolink.extTarget = _blank
        typolink.target= _self
        typolink.userFunc = user_typolink_class->main
      }


}

tt_content.text.20.parseFunc.tags.typolist.default.parseFunc.tags {
      link = TEXT
      link {
        current = 1
        typolink.extTarget = _blank
        typolink.target= _self
        typolink.userFunc = user_typolink_class->main
      }
}

falls du _blank für filelinks nicht benötigst kannst du die userFunc und das php script weglassen.

ich hoffe das hilft für die links im content.

gruss
salvi

-----------------------------------------------------------
Salvatore Vallesi
CS2 - Creative Solutions GmbH
http://www.cs2.ch
-----------------------------------------------------------

ms70 ·

das kann man doch im Constant-Editor unter 'Target for external links' ein-/ausschalten -- oder versteh ich jetzt die Frage falsch..?