Fix undefined variable in pagination template