Replaces id with link if no id presented.