Added parameter for sidebar element name.
Updated title algorithm.