Fix formatting of Course List block on course archive page #7180
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #7144.
Proposed Changes
Before we had the Course List block, we enabled people to use a grid layout for the course archive page by using the
sensei_course_loop_number_of_columns
filter. However, the CSS used for this wasn't specific enough and ended up leaking into other pages, namely those containing the Course List block.Note that this is only a problem if the page containing the Course List block is set as the Course Archive Page in the settings. If not, it works just fine.
This PR wraps the columns CSS inside the
.course-container
element, so that it doesn't affect other pages.Testing Instructions
sensei_course_loop_number_of_columns
filter and set it to 3 (or just change it in the code).Pre-Merge Checklist