-
Notifications
You must be signed in to change notification settings - Fork 384
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
[WIP] Add Title block for AMP Stories #2072
Conversation
This has alignment and controls to select h2, h3, or h4. The h2, h3, and h4 controls don't work yet, and other improvements are needed.
This seems to only apply to the Header block.
export const name = 'amp/amp-story-title'; | ||
|
||
export const settings = { | ||
title: __( 'AMP Title', 'amp' ), |
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.
title: __( 'AMP Title', 'amp' ), | |
title: __( 'Story Title', 'amp' ), |
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.
Don't accept this suggestion unless you want the CLA bot to start ❌'ing your PR 😏
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.
Importantly, modifying the title of the post needs to automatically update the block's text content. And modifying the text content, needs to modify the post title.
@@ -10,6 +10,7 @@ const Shortcuts = ( { insertBlock } ) => { | |||
const blocks = [ | |||
'amp/amp-story-text', | |||
'core/image', | |||
'amp/amp-story-title', |
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.
Is this right to include as a shortcut? It would only be used on the first page, and it should be part of the post type template so that it is inserted automatically when you create a new story.
/** | ||
* Saves the results of the edit component. | ||
* | ||
* @todo: possibly use PHP to render this instead, as the title could change. |
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.
Correct. The return value should be null
. A render_callback
should be used to render the current title with wptexturize
and all the normal the_title
behaviors.
@kienstra What's the current status here? Asking because I was looking at consolidating some code in the other blocks and I think I can use that to easily create these meta blocks here as well. |
@kienstra Also see this (in case you didn't see the discussion here): #2007 (comment) |
Status Hi @swissspidy, |
Reassigning the ticket to @swissspidy based on the conversation. As far as I understood then @kienstra moved over to working on other tickets already. Let me know if this information is incorrect. |
Closing this in favor of #2097. |
Sounds good, @miina. Thanks for handling this, @swissspidy. |
Closes #2007