layout and marco and paginate in index