-
Notifications
You must be signed in to change notification settings - Fork 8
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
Document how to override templates #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Change permalink structure: | ||
|
||
```shell | ||
wp-env run cli "wp rewrite structure '/%postname%'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty big thing to ask for. Why is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something I noticed is needed at the moment, so I documented it. There's an issue for it at #19, once that is fixed these instructions can be removed.
## Overriding templates | ||
The pages provided by this plugin are rendered using templates. If you so wish, you can use your own templates instead of this plugins's [default templates](templates). | ||
|
||
To do so, you should create an `openid-connect/` directory under your theme, containing only the templates you wish to override. For example, if you wanted to override `authenticate/main.php` and `authenticate/forbidden.php` you would create them under an `openid-connect/` directory in your theme: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused by the use of the directory authenticate/
. It is not necessary when overriding the templates? Why do we have this subdirectory in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
authenticate
is the page for which the templates are, i.e. the page with URI /openid-connect/authenticate/
. So there is one subdirectory per page.
At the moment there is only one page, but there might be other pages in the future, for example a page where you remove previously granted consent. Each page would get its own subdirectory under templates/
.
Starting with subdirectories since day one, even if there is only one page at the moment, allows us to not break backwards compatibility once (or if) we do introduce other pages. Because users can override these templates, moving them would break backwards compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the paths in the docs were wrong here, I fixed that in #33
No description provided.