[TYPO3] Splitting for a filename extenision

Peter Meijer peter.meijer at tros.nl
Tue Apr 4 13:12:05 CEST 2006


Hi all,

Currently I'm working on a project where I must display a filename with 
a specific icon (pdf, word, jpg, etc).

Now I must extract the extension from the filename.
For example:

Filename: filename.pdf

Typoscript:
        subimage = TEXT
        subimage.field = media
        subimage.split {
          token.char = 46
          cObjNum = 1
          1.current = 1
          1.wrap =  |
         }
         subimage.wrap =  |

return: filename and pdf

Now I get the first part of the split back, and I must get the last part.

How can I get the last part?

That was part 1 of the problem.

Now it's also possible to add files with multiple dots, like: 
filename.new.pdf

In this case the above typoscript won't work.
I know that there is a session variable called: SPLIT_COUNT and with 
that variable I can make a loop and then find the last part of the split.

But how can I get the session variable into typoscript?

Thnxs!
Peter Meijer



More information about the TYPO3-english mailing list