localgovdrupal / localgov_subsites_extras

Create menu-driven subsites. Add any content to a subsite and generate a menu to navigate to it.
GNU General Public License v2.0
1 stars 0 forks source link

Add subsites cache context. #23

Closed Polynya closed 4 months ago

rupertj commented 5 months ago

Thanks for this - it's nice to see the start of being able to override the branding :)

One thing I'm wondering is if the name of the context properly reflects what it is. Currently it's just "subsites" and it returns the value of the current subsite theme.

I'm thinking it could be better to have "subsite" and "subsite.theme" as contexts, as you might feasibly want to have two different subsites using the same colour scheme, but with different logos. "subsite" could just use the nid of the root node as its value.

Polynya commented 5 months ago

I meant to point out that it uses the theme.

Following the patterns here: https://www.drupal.org/docs/drupal-apis/cache-api/cache-contexts I think we could have:

rupertj commented 4 months ago

Ok, let's go for that. I think subsites by itself should be the node id, so I'll implement it like that.

rupertj commented 4 months ago

@Polynya I've made the changes. Care to give it a review?

Polynya commented 4 months ago

Looks good to me, thanks