Ivan Gretsky Posted Monday at 02:24 PM Share Posted Monday at 02:24 PM Good day @teppo! Another question from me) I am building a solution based on PW and Wireframe, that needs the theming functionality. That is switching theme (default views) for all the views and components. Layouts and partials probably too. Is there an easy way to achieve this with current code? Maybe a couple of hooks? I can see two ways how it could work. Put `alternative-default.php` everywhere the `default.php` files are and somehow tell Wireframe to use those prefixed files. If there is another view except the default one, the prefix should work as well. Like `alternative-json.php`. Probably an option should be available whether to fallback to defaults without the prefix or not. Create an overrides or theme folder somewhere and have somehow point Wireframe to use views from there. For my personal need the 1st approach seems to be a better one. But just maybe it is easy enough to provide possibility for both? Thanks! 1 Link to comment Share on other sites More sharing options...
teppo Posted 3 hours ago Share Posted 3 hours ago Hey Ivan, I'll have to get back to this later, but just wanted to say that this is an interesting idea. I've never really gone further than specifying a different layout file for different themes — so basically they've all had their own layouts, styles, etc. but still shared the same template specific views. And had a shared pool of components and partials. Both of your ideas sound feasible, but I must admint that the overrides/theme folder sounds "cleaner". It would probably be conceptually similar to WP child themes, e.g. you can override some features, but those that have not been overridden are the same as in the "parent theme" — right? That being said, the first one sounds like an easy to implement thing as well. I'll have to take a closer look at the code to be sure. 1 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted 2 hours ago Author Share Posted 2 hours ago 1 hour ago, teppo said: you can override some features, but those that have not been overridden are the same as in the "parent theme" — right Yes. But I think there could be an option to either use parent's features or to indicate that this one is yet to be implemented in a theme (through an error or warning). Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted 2 hours ago Author Share Posted 2 hours ago 1 hour ago, teppo said: hat being said, the first one sounds like an easy to implement thing as well. I'll have to take a closer look at the code to be sure. Great! Looking forward to see it in Wireframe! Thanks for your work and talent! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now