Towards the engineering of molecular nanostructures: local anchoring and functionalization of porphyrins on model-templates