Re: Question about theme layers
Reply #15 –
You can probably use the integrate_theme hook and check there to see if the theme matches the one you want then add a temporary hook via the add_integration_hook function.
Re: Question about theme layers
Reply #20 –
Ahrasis, learning new things is not the problem for me..
Using the word "fight" is probably not best word to use here, its nothing to be upset about - I, and probably most people here, do this in our leisure time and in that case choose actively to learn and use it(Elkarte or SMF scripts that is).
Yeah, it may be indeed easy to accomplish this(relatively speaking). But if the functionality of being able to change layer positions from the theme - or even just see the layer positions and subseqently the subtemplate ordering - is not there in a straight-forward way its clearly not something themes are meant to do in the first place.
For me it means an obstacle that will prevent me from creating a theme the way I envision it, that is all.
Re: Question about theme layers
Reply #23 –
I don’t think you want to theme to be ruler of all, I can largely grasp what you’re trying to do.
I’ve not done any theme development work really other than playing with css and changing the layers and pointing them to my own layer instead. So it’s slightly different.
Can you send me what you have so far? Or even a small template of what you’re trying to achieve. I’ll have a play and see if I can get it working.
Re: Question about theme layers
Reply #27 –
Will the custom theme index.template be loaded when the hook is executed I wonder...or can you add a path to index.template.php within the add_integration_function call? I am thinking to add the hook code there.
Re: Question about theme layers
Reply #28 –
The template_init seems to be run quite early in the execution path. So you’d want to aim for just before the _above template is called, I’d think.
The FILE points to the current file btw, so in this instance it's the file I edited index.template.php.
Re: Question about theme layers
Reply #29 –
The hook code itself is a function I assume - but I get a blank page when just adding it. If the function does not exist, all is fine..
So the hook code/function must perhaps do something or return something specific? (I am so out of tune on hook code lol)