Skip to content

Updating Tab placements #697

Answered by Thetwam
bertschj1 asked this question in Q&A
Jul 9, 2025 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @bertschj1,

The Course.get_tabs() method returns a paginated list of Tab objects. From the desired Tab object, you can call its update() 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 from get_tabs().

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 position or hidden.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bertschj1
Comment options

Answer selected by bertschj1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants