localgovdrupal / localgov_subsites_extras

GNU General Public License v2.0
0 stars 0 forks source link

Add subsites cache context. #23

Closed Polynya closed 1 month ago

rupertj commented 2 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 2 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 1 month 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 1 month ago

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

Polynya commented 1 month ago

Looks good to me, thanks