use ORM for layout_box table queries
rewrite TemplateManager::getFieldLength a bit