Community

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
denism
New Member

How do I make a relative path/link in a custom CSS to reference the file hosted in the course?

Jump to solution
Hi,
 
I'm creating a theme for Canvas using a customized CSS file. My idea is to create a kind of layout/template that will use an image hosted inside the files folder of each course - I want to use a "background.png" file, and each course would have a different version of this file in its files folder.
 
How do I make a relative path/link so that it would automatically reference the file hosted in the course I put the link in?
 
For example, imagine a course of id 01, and another of id 02. Both would use a background image hosted in their own files folder. Then, in my CSS file I'd have something like this:
 
Background-image: url(/files/bg.png)
 
But those two courses would print different backgrounds, since I'd have two different file names "bg.png", each in their respective files folder. Could I create this kind of relative path/link here? If so, how?
0 Kudos
1 Solution

Accepted Solutions
Stef_retired
Community Team
Community Team

Hi,  @denism  Welcome to the Canvas Community! Although I don't have an immediate answer for you, I wanted to let you know two things:
(1) As this is a duplicate of a question you posted a few minutes ago—https://community.canvaslms.com/thread/35677-how-do-i-make-a-relative-path-in-a-custom-css-file-to-r... —we're going to ask our members to post their responses to that question, and we've locked this one to future participation to prevent parallel and possibly duplicative threads from developing.

(2) I've shared the first question with the Canvas Developers group to get the eyes of your fellow experts. You won't need to join the group to see their responses, but if you'd like to join it, you can easily do so by navigating to the group and selecting Join Group from the Actions dropdown at the upper right of the group's home page.

View solution in original post

0 Kudos
1 Reply
Stef_retired
Community Team
Community Team

Hi,  @denism  Welcome to the Canvas Community! Although I don't have an immediate answer for you, I wanted to let you know two things:
(1) As this is a duplicate of a question you posted a few minutes ago—https://community.canvaslms.com/thread/35677-how-do-i-make-a-relative-path-in-a-custom-css-file-to-r... —we're going to ask our members to post their responses to that question, and we've locked this one to future participation to prevent parallel and possibly duplicative threads from developing.

(2) I've shared the first question with the Canvas Developers group to get the eyes of your fellow experts. You won't need to join the group to see their responses, but if you'd like to join it, you can easily do so by navigating to the group and selecting Join Group from the Actions dropdown at the upper right of the group's home page.

0 Kudos