Update base.html

Changed hard-coded 'aggregate' id to a variable, and added conditions for inclusion