fix: #3616545 Replace the static event and news cards in Canvas pages with views blocks
Closes #3616545.
Problem
Several Canvas default-content pages hard-code event and news cards instead of placing a views block, so the "related" sections never change and repeat the same items. On /research and /admissions the same news title — University Launches New Artificial Intelligence Research Center — was rendered 10 times, and /anthropology repeated one event 3 times. None of those pages contained a single views block.
Home and About were already converted; the rest were left behind.
Change
Replace the static cards with the views blocks the recipes already ship:
| Page | Section | Was | Now |
|---|---|---|---|
| Anthropology | Events you may also like | 2 x card-dated-vertical |
events-latest (2) |
| African and American Studies | Events you may also like | 2 x card-dated-vertical |
events-latest (2) |
| Research | How Our Students Are Thriving | 4 x card-dated-vertical + 2 x card-featured |
events-latest (4) + news-featured (2) |
| Student Life | How Our Students Are Thriving | same | same |
| Admissions | How Our Students Are Thriving | same | same |
| Tech & AI Innovation Conference | How Our Students Are Thriving | same | same |
Also config/canvas.pattern.eventlastrow.yml: the reusable Event last row pattern carried the same static pair, so anyone placing it reproduced the bug.
events-latest is the Upcoming events display added in Varbase Events Base 1.0.0-alpha2; events-related is node-contextual and renders nothing on a Canvas page, so it is not usable here.
Net: 912 lines of hard-coded card markup removed, 80 added.
Testing
Fresh drush site:install of the Educare recipe on a clean Varbase 11 build, before and after.
Before — /research, /admissions: views-element-container 0, repeated news title 10.
After:
| Page | View blocks | Items | Repeated title |
|---|---|---|---|
| /research | 2 | 4 events + 2 news | 0 |
| /admissions | 2 | 4 events + 2 news | 0 |
| /student-life | 2 | 4 events + 2 news | 0 |
| /anthropology | 1 | 2 events | 0 |
All items are distinct and link to real nodes (/events/tech-ai-innovation-conference, /events/research-innovation-showcase, /events/student-success-conference, /events/scholarship-information-session; /news/...). 0 console errors on the checked pages.
Open point for review
On the two "Events you may also like" pages the original markup put one card in col_1 and one in col_2 of the same row — a hand-built two-across grid. A views block renders the whole list itself, so two blocks of one item each would render the same top result twice. The list is therefore placed once, in col_1, which leaves col_2 empty: measured 550px of a 1224px row, the two events stacked rather than side by side.
That matches how Home already renders events-latest in a half-width column, but it does change this section from 2-across to 2-stacked. If the side-by-side look should be kept, the row wants collapsing to a single full-width column — happy to add that if preferred.
AI-Generated: Yes
Checkpoints:
- File an issue
- Addition/Change/Update/Fix
- Testing to ensure no regression
- Automated unit testing coverage
- Automated functional testing coverage
- UX/UI designer responsibilities
- Readability
- Accessibility
- Performance
- Security
- Developer Documentation
- User Guide Documentation
- Reviewed by human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Release notes snippet
- Release