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

Added prepent text to tag block #30048

Closed
wants to merge 2 commits into from

Conversation

Quintis1212
Copy link
Contributor

Hello ) This is an enhancement for "Category and tag blocks: Add option to prepend text" #29909 . I added Rich Text component to tag block , but it is not saving changes when I click publish and go to published page. Please , who can help me with saving changes ?

@ntsekouras
Copy link
Contributor

ntsekouras commented Mar 22, 2021

Hey @Quintis1212 - thanks for working on this!

Can you please setup linter/prettier (https://developer.wordpress.org/block-editor/contributors/code/getting-started-with-code-contribution/#developer-tools)? There are many whitespace changes introduced that are not needed :)

I added Rich Text component to tag block , but it is not saving changes

Also without checking thoroughly your code, if we introduce a new block attribute (byline) we need to declare it in the block's block.json file.

@ntsekouras ntsekouras added [Block] Categories Affects the Categories Block [Block] Post Tags Affects the Post Tags Block and removed [Block] Categories Affects the Categories Block labels Mar 22, 2021
@Quintis1212
Copy link
Contributor Author

Hey @Quintis1212 - thanks for working on this!

Can you please setup linter/prettier (https://developer.wordpress.org/block-editor/contributors/code/getting-started-with-code-contribution/#developer-tools)? There are many whitespace changes introduced that are not needed :)

I added Rich Text component to tag block , but it is not saving changes

Also without checking thoroughly your code, if we introduce a new block attribute (byline) we need to declare it in the block's block.json file.

Hi @ntsekouras ) I installed prettier as you advised to me and add block to json file

Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

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

Thanks for following on this! If you've set up linter/prettier, please push the proper changes to make it easier to review and the CI happy :) (https://github.com/WordPress/gutenberg/pull/30048/checks?check_run_id=2207905167)

The direction is going is good though and we need some polishing here 👍

</BlockControls>
<div { ...blockProps }>
<RichText
className="wp-block-post-author__byline"
Copy link
Contributor

@ntsekouras ntsekouras Mar 29, 2021

Choose a reason for hiding this comment

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

This needs to change to post-tags block (wp-block-post-author__byline -> wp-block-post-tags__byline).

multiline={ false }
aria-label={ __( 'Byline text' ) }
placeholder={ __( 'Write byline…' ) }
value={ byline }
Copy link
Contributor

Choose a reason for hiding this comment

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

keepPlaceholderOnFocus property could be useful here..

@@ -33,7 +34,7 @@ function render_block_core_post_tags( $attributes, $content, $block ) {
}

$output = trim( $output, ' | ' );
$output .= '</div>';
$output .= '</div>'.( ! empty( $byline ) ? '<p class="wp-block-post-author__byline">' . $byline . '</p>' : '' );
Copy link
Contributor

Choose a reason for hiding this comment

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

byline output should be inside the block and before the list output, as is in the editor. Also the class name should be about post-tags.

@carolinan
Copy link
Contributor

Hi!
I am closing this pull request because #40559 has been merged instead.

@carolinan carolinan closed this Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Tags Affects the Post Tags Block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants