{subtemplate common/header} {eval $i=1;} $datarow[sort] {eval $i++;} {eval $i=1;} {subtemplate common/footer}