compile the html contents for a popup