Add the title and class when building the <li>