[TYPO3] Mark external links

Peter Klein peter at umloud.dk
Tue Jul 11 22:01:04 CEST 2006


Hi Robert. I can't find it anywhere myself either :(
I made a recreation of it, except for the mailto: part, which is a bit 
trickier, as you need to split the content one more.. (Im not sure if it has 
been run through "spamProtect" at this stage or not, but if it has, you 
can't test for the "@" char).
But you can play around with that yourself.. Here's the TS snippet..

-- cut --

# Redefine lib.parseFunc.tags.link
lib.parseFunc.tags.link >
lib.parseFunc.tags.link = COA
lib.parseFunc.tags.link {

  # Test and see if the 1st parameter is numeric
  # (Internal link)
  10 = TEXT
  10.value = [I]
  10.if.isTrue.cObject = COA
  10.if.isTrue.cObject {
    10 = TEXT
    10.data = parameters : allParams
    10.split {
      token.char = 32
      cObjNum = 1 || 2
      1.current = 1
    }
    10.intval = 1
  }

  # Test and see if the 1st parameter is NOT numeric
  # (External link)
  20 < .10
  20.value = [E]
  20.if.negate = 1

  30 = TEXT
  30.current = 1

  stdWrap.typolink.parameter.data = parameters : allParams
  stdWrap.typolink.extTarget = {$styles.content.links.extTarget}
  stdWrap.typolink.target = {$styles.content.links.target}
  stdWrap.parseFunc.constants =1
}

# Also copy it into lib.parseFunc_RTE.tags.link
lib.parseFunc_RTE.tags.link >
lib.parseFunc_RTE.tags.link < lib.parseFunc.tags.link

-- cut --

--
Peter Klein / Umloud Untd.

"Robert Markula" <robert.markula at gmx.net> wrote in message 
news:mailman.1.1152645468.3375.typo3-english at lists.netfielders.de...
> Peter Klein wrote:
>> Hi Robert. It can be done with Typoscript.. Simply extend 
>> "lib.parseFunc.tags.link" and check the links. As all numeric values are 
>> internal inks. (To check for mail links, you could simply split the link 
>> at the "@" char, and see if the 2ndpart of the split has any value or 
>> not..
>> I posted an example on the old TYPO3 FAQ list, showing the above method, 
>> but unfortnatly I can't find a link to it anywhere. :(
>
> Hmm do you have any idea how it worked? I searched google, but without any 
> result. As this feature is IMHO not that unimportant for usability and 
> accessibility, I'd like to put up a howto on the wiki as soon as there is 
> a solution.
>
> If everything else fails, I'd use Sebastian's solution, but as I stated 
> earlier: I'd prefer a TS based solution if there is any.
>
> Cheers,
> Ro 





More information about the TYPO3-english mailing list