adding a contextualLink function to the main template