Skip to content
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

Merged
merged 5 commits into from
Sep 12, 2022
Merged

Document how to override templates #28

merged 5 commits into from
Sep 12, 2022

Conversation

psrpinto
Copy link
Member

No description provided.

@psrpinto psrpinto self-assigned this Sep 12, 2022
@psrpinto psrpinto requested a review from ashfame September 12, 2022 14:11
Copy link
Member

@ashfame ashfame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

README.md Show resolved Hide resolved
@psrpinto psrpinto added this to the 1.0 milestone Sep 12, 2022
@psrpinto psrpinto merged commit 1b690ee into main Sep 12, 2022
@psrpinto psrpinto deleted the docs branch September 12, 2022 17:39
Change permalink structure:

```shell
wp-env run cli "wp rewrite structure '/%postname%'"
Copy link
Member

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?

Copy link
Member Author

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:
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants