Fix bug where for loop iterator was being reused.

Added second for loop iterator variable for inner for loop.
Add embed block in footer template.