-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Reusable templates #1
Comments
Cool, that's a good suggestion, and I think it should already be possible (maybe with a very small change). Let me test it. The current route can be retrieved by using get_query_var('template'), unless you specify a different query_var in the constructor of the Router.. |
I ended up taking this concept and making my own router for my use case. I don't need the permalink creation, as my templates will match to real pages/posts in WordPress. I also implemented Express style PathToRegex syntax so it's eay easier to handle more complex routes. You can check it out here: https://github.com/drewbaker/wp-easy/blob/main/functions/libs/WpEasyRouter.php
|
I'd love to be able to make templates reusable, and then also be able to get the name of the active template.
I think it can be done without a breaking change, and would make the router really really powerful!
So I could do something like this:
This would make my templates more reusable, and allow me to keep my route based logic all based on the config in my router.php file.
The text was updated successfully, but these errors were encountered: