Wigdet coursepress showing up in modular view

I have a problem with the Widget course structure in that it is showing up in modular view. I need this to be in the units. But if the course setup is set to "Do not show structure" the course overview does not need to show. The widget headline is still there. See screenshot:

So class: widget cp_course_strucutre_widget display none of the options in step 2
Course setup: "View course overview, structure and preview options".
But when I set this to off it does not show inside the course. See screenshot:

I tried this code:

In archive-unit.php it will show up in all places like the other widget: In course overview, course list, and inside the units. Archive-unit.php is NOT the file to use. I need to know which template displays ONLY units inside a course.