cancel
Showing results for 
Search instead for 
Did you mean: 
joseph_allen
Community Champion

Is there a way to centrally insert content into every Canvas page in our district?

Jump to solution

Is there a way to centrally insert content, like a new standard disclaimer or a piece of content that we want every teacher to have displayed on their Canvas pages?  The key here is, we want to initiate and control this centrally, not have every teacher cut and paste the content.  

1 Solution

Accepted Solutions
bbelew
Community Contributor

I concur with Kona on posting to the developers group.

That said there are a couple ways you could do it, I assume they'll say something similar.    The canvas admin would use the custom javascript file to inject the content into the page.     Most likely prepending to the element <div id="content" role="main" >.

If the content needed to change on a regular basis, it could be an iFrame to a simple html file you edit or more complex it could pull from atom/rss and update whenever something new is posted to say a category on your website.

If it needed to target a specific user group the javascript would have to figure out what group the user belongs to.  At the bottom of each page there is a chunk of javascript, in that --   current_user_roles":["user","student","teacher","admin"].

View solution in original post

6 Replies
kona
Community Coach
Community Coach

 @joseph_allen ​, for what you're looking for it might be good to share this with the Canvas Developers​ group in the Community. They are the back-end programmers who would be the ones doing stuff like this. Hope they can help!

bbelew
Community Contributor

I concur with Kona on posting to the developers group.

That said there are a couple ways you could do it, I assume they'll say something similar.    The canvas admin would use the custom javascript file to inject the content into the page.     Most likely prepending to the element <div id="content" role="main" >.

If the content needed to change on a regular basis, it could be an iFrame to a simple html file you edit or more complex it could pull from atom/rss and update whenever something new is posted to say a category on your website.

If it needed to target a specific user group the javascript would have to figure out what group the user belongs to.  At the bottom of each page there is a chunk of javascript, in that --   current_user_roles":["user","student","teacher","admin"].

View solution in original post

joseph_allen
Community Champion

Brandon, this is helpful.  If we wanted to apply something to just a certain kind of page, i.e. teacher home page.  I can't think of anything in a given page that calls it that, but perhaps tag those pages and java script can then apply the custom content?

bbelew
Community Contributor

The way canvas lays out it's html, it looks like it's all the same content for every user role with the exception of links to content those users don't have access to.   So your right, there isn't ( at least that I can find ) a way to put something in a container that only teachers can see, without first checking to see if that user is a teacher by parsing the current_user_roles portion out of the javascript and looking for "teacher","admin".  

clong
Community Champion

Hi  @joseph_allen ​,

I don't know of a way to target just specific pages but here is a script I've used to add a Copyright date at the bottom of each page in Canvas.

$('#wrapper-container').append('<div style="text-align:center;font-size:small;margin-bottom:6px;">&copy; Copyright ' + new Date().getFullYear() + ', Name of Your School</div>');

This along with  @bbelew ​ excellent suggestion, should help you. If you find that there's a better way to do this, please let us know. For now I'll mark this as answered, but the comments will remain open for further discussion Smiley Wink

joseph_allen
Community Champion

Thank you.  We'll try this.   What we're trying to append to teacher home pages is the electronic systems privacy and use policy language for the whole school district and we'd like it to be consistent across all pages.