By: Elaine Jones, Product Manager
Overview
In our October 20.24.10 release we introduced a new configuration variable, d2l.Tools.WYSIWYG.LinkPathDetection for Brightspace Editor. This configuration variable, when enabled, displays warnings to users who are creating or editing HTML content where the URLs to objects (such as, images, PDFs, or documents) within course content do not reside within current course offering.
D2L recommends that this configuration variable be enabled for your organization for the following reasons:
- Learners may not be able to see the content you create if URLs to objects do not point to the correct course offering
- When copying content to a new course offering, the URL to the object is maintained which causes the issue to propagate to new course offerings being created
Without the detection in place, it is not possible to easily see these problems before they affect users who are taking courses.
How does the configuration variable work?
Once enabled, users who edit HTML content may see an orange border surrounding objects with URLs that are not pointed to the current course offerings Manage Files area. The warning appears as a tooltip when the item is clicked into that states that “This links to a file that exists outside of the current course, which means some users may see a broken link. Insert the content you need using a file in this course or from your computer.” The item that was detected is surrounded by an orange border to highlight the area of concern on the page.
For example, let’s say you added an image within a quiz question in a course offering whose course offering path was ‘/content/CourseB’ but the URL/link path to the image in the quiz question pointed to ‘/content/CourseA/Image.jpg’. This means that the image in the quiz question does not belong to the course offering you are editing the quiz question in, and so the editor displays an orange border around the image and provide the warning tooltip with information.
It is likely that learners taking the quiz would be unable to see the image, especially if your organization has enabled the configuration variable d2l.Tools.ManageFiles.UseContentEnrollmentSecurity which does not allow users to see files within a course offering, unless they are enrolled into that course offering.
Figure: An example of the file path URL detection showing an error.
How to resolve issues the configuration variable detects?
In the example above, the image should be deleted, and re-inserted into the quiz question using a file that exists within the current course offering. This ensures that the object shown in the quiz question exists within the current course offering and is visible to users taking the quiz. This also ensures that should you copy the quiz question to another course offering, the image is also copied as expected and it displays as expected.
What is not detected by the configuration variable?
When enabled, this does not detect external URLs that are invalid or not working. This includes external URLs or Brightspace URLs and quicklinks where the link may generate a 404 error.
How can I test the configuration variable is working?
- Create 2 course offerings (Course A and Course B).
- In the Manage Files area of Course A, upload an image file.
- In Course B, create a new HTML Content/Pages file and add an image using Insert Image in the editor toolbar.
- Edit the HTML source code of the content file and replace the path to the inserted image with a path to the image in Course A (for example, /content/courseB/image.jpg becomes /content/courseA/image.jpg so that it points to a different course offering).
- Save the source code - the image should display but be surrounded by an orange box because the file comes from a different course offering.
- Click onto the orange box and notice a tooltip explaining that the item linked has a different course offering in the URL that the course offering you are currently in.
Alternatively, you could:
- In a course offering, create a new HTML Content/Pages file and add an image using Insert Image in the editor toolbar.
- Using your browser, copy the content within the editor window (Ctrl+c for Windows or Cmd+c for Mac).
- In a new course offering, create a new HTML Content/Pages file and then paste the copied content (Ctrl+v for Windows or Cmd+v for Mac).
- The URL of the pasted contents image continues to point to the original course offering and the image is surrounded by an orange box. This is because the file comes from a different course offering.