Hi, looks like you are reinventing the wheel. If you want to link to db records in RTE you should take a look at EXT:ch_rterecords. At least you should find some hints there. Cheers, Michael