Chris Kenniburg and I worked together on something a bit like this for tagged or promoted courses. I think it was in one of the versions of flexibase, but I'm not at my development PC right now to check back. (I think for Chris it was the theme he had built prior to Fordson)
https://github.com/roelmann/moodle-theme_flexibase/commit/3d629efa2933d1f6152bfabf8fe0acadcbe19938