moving the theming logic under microsites

115 views
Skip to first unread message

James Tauber

unread,
May 29, 2014, 5:20:48 PM5/29/14
to edx-...@googlegroups.com
I've been working on a default footer that is generic for Open edX, not specific to edx.org.

Currently we have code in places like main.html that checks to see if theming is on, if so uses the theming template overrides, if not uses microsite's get_template_path which in term checks to see if microsites are used, if so uses the microsite template overrides and if not falls back to the original template name.

Rather than add yet another bit of logic to main.html itself, I thought'd I'd put the logic in microsites which immediately led to the question: why not put the theming logic there too.

Assuming that everywhere that checks for theming also checks for microsites, I'm proposing MOVING the logic that checks for theming and sets the theme template overrides INTO microsites.get_template_path.

Note I'm not proposing completely merging the notion of microsites and themes (yet) just containing all template overriding logic to a single place.

As a follow-on step, I could rename microsites as it's now a little more general. OR rather than calling microsites.get_template_path directly, I could move get_template_path out of microsites and have it just route to microsites if necessary. But that's a separate refactor.

Any concerns before I start working on a PR?

James



James Tauber

Felipe Montoya

unread,
Jun 1, 2014, 8:05:14 PM6/1/14
to edx-...@googlegroups.com
Hi James,

I like this idea, I know microsites are more than just theming, but definitely the logic selecting the templates would be easier to manage if it was in a single place. I was checking in the templates and apart from the place in main.html where the footer, header and so on are selected, there is also a lot of places where the template uses 'self.theme_enabled()' or 'self.stanford_theme_enabled()'. Are you considering those as well? or mainly the selection on main.html?

--
Felipe Montoya

Sébastien Hinderer

unread,
Jun 2, 2014, 3:35:35 AM6/2/14
to edx-...@googlegroups.com
Hi James,

How would the logic you propose work on an installation where microsites are
disabled?

Thanks!
Sébastien.

Jason Bau

unread,
Jun 2, 2014, 2:53:41 PM6/2/14
to edx-...@googlegroups.com
Hi James,

Although "Stanford theming" has become sort of a thing, it was built entirely out of necessity and we're aware (and apologetic) of hackery that exists. We'd definitely support something that starts us down the path of cleaning up theming.

Thanks!
Jason
Reply all
Reply to author
Forward
0 new messages