Skip to content

Added prepent text to tag block#30048

Closed
Quintis1212 wants to merge 2 commits into
WordPress:trunkfrom
Quintis1212:prepend-text
Closed

Added prepent text to tag block#30048
Quintis1212 wants to merge 2 commits into
WordPress:trunkfrom
Quintis1212:prepend-text

Conversation

@Quintis1212
Copy link
Copy Markdown
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 ?

@Quintis1212 Quintis1212 requested a review from ajitbohra as a code owner March 19, 2021 21:25
@ntsekouras
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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..


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