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

Add support for pages #188

Closed
wants to merge 10 commits into from
Closed

Conversation

technosailor
Copy link

This addresses Issue #176

@mjangda
Copy link
Contributor

mjangda commented Feb 17, 2016

We'll want a custom template for Pages (e.g. no need to include the author/date/category/tags) and will need to adapt things like the JSON metadata so that it accurately reflects the content (e.g. BlogPosting or NewsArticle don't make sense for the type) before we roll out support for pages.

@technosailor
Copy link
Author

Gotcha. Thanks for the clarification

@technosailor
Copy link
Author

@mjangda, Updated the PR with modifications for the metadata. Note that I decided to go the route of checking for if the post type is hierarchical instead of simply checking for pages. Allows us to roll out CPT support as another issue, or at a later time.

@technosailor
Copy link
Author

I think we could probably do something around a factory class for the templates and/or a base class that other template types can extend, but that's more out of scope for this issue.

@mjangda mjangda added this to the v0.4 milestone Feb 18, 2016
@technosailor
Copy link
Author

@mjangda, out of curiosity, what's your timeline for 0.4?

@mjangda
Copy link
Contributor

mjangda commented Feb 19, 2016

I think we could probably do something around a factory class for the templates and/or a base class that other template types can extend, but that's more out of scope for this issue.

Yeah, that's sort of what I was originally envisioning too.

what's your timeline for 0.4?

Aiming for next week or two.

@technosailor
Copy link
Author

Is there an issue for that? I can work on it. Already been tossing it around in my head how to do it extensibly and properly. Or I could just update the PR with new code that takes that into account for this new template.

*
* @since 0.2
*/
$metadata = apply_filters( 'amp_metadata', array_merge( $metadata, $article_meta ), $this );
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have a filter further down, so this is unnecessary.

@mjangda
Copy link
Contributor

mjangda commented Feb 19, 2016

Is there an issue for that? I can work on it. Already been tossing it around in my head how to do it extensibly and properly.

No issue for it, but would love to hear what you're thinking. If it'll majorly change the direction of this PR, then it probably makes sense to close this and just run with that.

Overall, though, this PR looks pretty solid; thanks for tackling it! Left a few comments and questions.

@technosailor
Copy link
Author

Yeah, I'll clean this up this week. My idea would change the template portion of the PR, but I don't think it should block the inclusion of this PR. That would just be a secondary PR that adjusts this.

The thought is a class that has things like display_meta(), display_comments, do_schema() or whatever? A base class for single templates would have something like render_template() that could be modified by extending this class and replacing that method, or anything specific to the template.

Thoughts?

@mjangda
Copy link
Contributor

mjangda commented Feb 25, 2016

Going to do some more quick tests but I think this is ready to ship.

@gabrielperezs
Copy link

I add support for tags, category, pagination, author, and home page (as archive). Also added some filters to change the URL of the elements when it is "within amp", for paging, tags, etc .. on this repo: https://github.com/gabrielperezs/amp-wp

What do you think about? I ask because I made several changes I do not know if they go on line / plan.

In my version, I still have clean code, repeat functions for AMP_Archive_Template, AMP_Post_Template and AMP_Common_Template. But it is ready to be tested.

Diff https://github.com/Automattic/amp-wp/compare/master...gabrielperezs:maste

@eedeebee
Copy link

What is status of this work? I'd love to use this on a small site.

@ghost
Copy link

ghost commented Jun 14, 2016

Again, what's the status with allowing AMP on pages? This looks likes it was ready as of 25th February. Any update?

@fabtigger
Copy link

Hello do you know when or if page support will be ready? It looks like you've already started the work here.

This would be really good for website based wordpress sites. I understand that you guys are busy and appreciate that you have put so much time and effort into the project already, So not pressuring just wondering as I imagine a lot of wordpress members would love this.

@envintus
Copy link

envintus commented Nov 3, 2016

@mjangda and @technosailor,
Is this pull request dead? It received a lot of attention back in February and was even described as ready to ship, but is marked for milestone v0.4. Unless the WordPress plugin directory version and the version maintained in this repository do not match then this project is already at v.0.4.2, surpassing a v0.4 milestone.

Which begs the question: What's the hang up here?

@tholu
Copy link

tholu commented Nov 5, 2016

I'm wondering as well, why this PR has not been merged already (currently 2 files are conflicting @evintus). Pages support is crucial for this plugin to take off in my opionion.

@wesklei
Copy link

wesklei commented Nov 14, 2016

Hello, do you know when or if page support will be ready?

@envintus
Copy link

I wonder if the following Trac ticket has anything to do with why this isn't being merged in to master?
https://core.trac.wordpress.org/ticket/31438

When I fork and add support for pages I can confirm that the front-page 404's and does not handle the query/amp canonical redirect correctly, but non-front-page pages work just fine.

@westonruter westonruter mentioned this pull request Oct 26, 2017
@westonruter
Copy link
Member

See also #619.

@mjangda mjangda mentioned this pull request Nov 7, 2017
@westonruter westonruter modified the milestones: v0.4, v0.6 Nov 7, 2017
@ThierryA ThierryA assigned ThierryA and unassigned ThierryA Nov 27, 2017
@ThierryA ThierryA mentioned this pull request Dec 7, 2017
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.

10 participants