-
|
Hi, I need help with the structure of updating the Tab placement function - I can't wrap my head around it for some reason! I want to get all my tabs, then place an external tool tab into the course navigation. Here is my general code: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @bertschj1, The Something like this should do the trick: course = canvas.get_course(COURSE_ID)
tabs = course.get_tabs()
for tab in tabs:
if "Packback" in tab.label:
tab.update(position=2, hidden=True)You may need to adjust |
Beta Was this translation helpful? Give feedback.
Hi @bertschj1,
The
Course.get_tabs()method returns a paginated list ofTabobjects. From the desiredTabobject, you can call itsupdate()function directly. For whatever reason, Canvas doesn't let you get a tab object directly from an ID, so you'll have to use one of the ones in the list fromget_tabs().Something like this should do the trick:
You may need to adjust
positionorhidden.