I have a problem with our site and what follows is my tentative workaround and how it's a hack.

We are using a "sites" taxonomy vocabulary to control the switching of themes based on what 'site' a particular is categorized as. The functionality in most cases uses current($terms) which means that we get the first term. In our case, we want the last term (as defined by the numbering) because the lowest tid is our default site and we want 'sub-sites' to supplant that.

So, where I needed this changed I changed it to end($terms) so that the highest applicable term (by tid) kicks in.

Is there a better way to weight these terms? What if current() were replaced with a function call to a new function in taxonomy_theme? This function would need a config screen. My thinking is that it would need these weighting options:

  • weight by tid ascending
  • weight by tid descending
  • weight by name ascending
  • weight by name descending
  • weight by parentage (term_heirarchy parent) ascending
  • weight by parentage (term_heirarchy parent) descending
  • weight by weight (as in system.weight value) ascending (then maybe a way to affect those)
  • weight by weight (as in system.weight value) descending (ditto)

All the best,

Mike

Comments

dewolfe001’s picture

Status: Active » Closed (works as designed)

My workaraound was this:

  • couple a theme with a taxonomy code
  • go into the extended pathes and match themes to taxonomy with a string like this : node/*/36 or node/*/308
  • alter the links you output to append a suffix to the node links built: e.g. convert "node/2121" to read "node/2121/36"
  • when the link it passed through, most of the hooks will ignore this numeric arg(2), but it will be picked up by extended pathes matching
  • this will force a theme and the links on the page to preserve the theme on the next page.