How do I sub classing a layer to overide an already overriden page template by jbot?

StackOverflow https://stackoverflow.com/questions/20976168

  •  25-09-2022
  •  | 
  •  

Question

Similar to the problem in this question (How can I override an already overriden template by jbot?) I am using a base skin that contains jbot overides to template files that I want to overide again.

My product is based on a theme called responsive theme. This theme contains overrides I wish to change.

skins.xml:

<skin-path name="buyspoke-theme" based-on="Responsive Theme">

configure.zcml

<browser:jbot
    directory="templates"
    layer=".browser.interfaces.IThemeSpecific" />

the jbot overrides in 'responsive theme' are taking priority. I realize from the question above the solution is to 'subclass a layer', I suppose my question is how? An idiot guide would be much appreciated.

Was it helpful?

Solution

You must provide another jbot registration in another product:

<browser:jbot
      directory="templates"
      layer=".your.product.CustomInterface" />

Then your interface must be something like this:

from .... import IThemeSpecific

class CustomInterface(IThemeSpecific):
    pass

And you must register a browser layer for you product.

So: your new interface is subclassing the interface from the theme.

Another way is to use z3c.unconfigure.

Note: I fear that both ways will replace all of the templates inside the original folder (so I think you can't simply customize a single template).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top