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 Site Title to Dynamic Block #216

Merged

Conversation

salcode
Copy link
Contributor

@salcode salcode commented Apr 29, 2022

I appreciate @ryanwelcher's suggestion on simplifying PR #205

This PR adds the Site Title option value (found at Settings > General)

image

and adds it to the "10-dynamic-block" example.

Front End

image

In the Editor

image

Note: In the editor the Site Title (in this case "gutenberg-examples") can not be modified.

Resolves #203

Since this is a dynamic block, we can modify the markup at run time
(instead of saving the markup in the database to be displayed).

In this case, we are appending the Site Title of the blog to the message being
output.

If we were to go to
Settings > General
and modify the "Site Title" setting, the rendered output would change
(without our re-opening the post in Gutenberg).

See WordPress#203
The Site Title is not modifiable within the block, but if we
were to go to
Settings > General
and modify the "Site Title" value.

When we reload the post in Gutenberg, the Site Title would be updated.

See WordPress#203
Copy link
Contributor

@ryanwelcher ryanwelcher left a comment

Choose a reason for hiding this comment

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

Just one small comment but overall this looks great to me!

We've made some pretty big structural changes to the repo so there are a lot of merge conflicts to resolve as well.

10-dynamic-block/src/edit.js Outdated Show resolved Hide resolved
@ryanwelcher
Copy link
Contributor

Just looks like there are some linting issues to address but after that I think we can merge this!

@salcode salcode requested a review from ryanwelcher May 27, 2022 21:01
@salcode
Copy link
Contributor Author

salcode commented May 27, 2022

I'm seeing linting issues, which I will revisit and update this PR.

@salcode
Copy link
Contributor Author

salcode commented May 27, 2022

Linting issues should be resolved now.

Copy link
Contributor

@ryanwelcher ryanwelcher 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 putting this together. It's a nice addition!

@salcode
Copy link
Contributor Author

salcode commented Jun 24, 2022

Is there anything else I can do to help get this merged now that the PR is approved?

@ryanwelcher ryanwelcher merged commit b835136 into WordPress:trunk Jun 24, 2022
@ryanwelcher
Copy link
Contributor

@salcode thanks for the follow-up! I was assuming that you could merge. At any rate, it's merged, and once again thanks for your contribution 😄

@salcode
Copy link
Contributor Author

salcode commented Jun 24, 2022

Ha ha, I appreciate your overestimating my powers 😀 @ryanwelcher

Thanks for the merge! Have a great weekend.

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