Forum Replies Created
-
AuthorPosts
-
Zac Gordon
KeymasterOkay, I guess I need to see the code where you are using this with your Gutenberg block.
Is this for a dynamic block? Could I see how you’re integrating this with the PHP for the dynamic block? Within that you should have access to the global $post if you need.
Thanks!
Zac Gordon
KeymasterIs this in a dynamic PHP block? Mind posting all of the PHP code for this so I can see the whole thing? You should have access to the $post to grab the ID but I might be misunderstanding.
September 10, 2018 at 4:42 pm in reply to: Adding panels and controls to document settings tab – now possible? #57328Zac Gordon
KeymasterYes there is. I’ll be covering it in an advanced Gutenberg course later this year. Not sure I’ve seen any tutorials on it yet either.
September 3, 2018 at 5:18 pm in reply to: Extending the course with "real world" developlment examples #56428Zac Gordon
KeymasterSweet!
I will definitely be doing one of those later this year 🙂
September 3, 2018 at 3:16 pm in reply to: Extending the course with "real world" developlment examples #56415Zac Gordon
KeymasterHi there
I didn’t have plans to extend this section. However if there is a certain real world block plugin out there you want to see covered I can try reaching out to the developer and see if they are open to contributing an overview.
This section is not so much tutorials but more a high level overview of real world projects using JS.
If you’re trying to just learn Gutenberg Development I have two courses available and a third coming later this year.
September 2, 2018 at 3:57 pm in reply to: Update select options based on another control's value? #56340Zac Gordon
KeymasterHi!
I’m not really what the problem is you’re describing. Could you explain on this please, maybe share your code too
“Where I’m stuck is updating the options for a different select element–I cannot seem to hit on the right function to update/replace the options in the taxonomy/term dropdowns (on the block–the widget does it just fine, but the block requires a different approach).”
As a general note, you probably should be using the new Data models and not making your own api calls as they won’t be as integrated.
Hope can help if you don’t mind explaining a little more the problem.
September 2, 2018 at 3:55 pm in reply to: What will be the accepted method to determine in PHP which editor will be used? #56338Zac Gordon
KeymasterI am not sure if this specifically, but check out the source code for the Gutenberg Ramp Plugin. It does testing and turning on and off of Gutenberg and is built by Automattic so should serve as a good example for how to do on your own.
Also look at how the Classic Editor plugin does it too 👍🏼
September 2, 2018 at 3:55 pm in reply to: What will be the accepted method to determine in PHP which editor will be used? #56336Zac Gordon
KeymasterI am not sure if this specifically, but check out the source code for the Gutenberg Ramp Plugin. It does testing and turning on and off of Gutenberg and is built by Automattic so should serve as a good example for how to do on your own.
Also look at how the Classic Editor plugin does it too 👍🏼
Zac Gordon
KeymasterI am not exactly sure what you are trying to do here but Block Templates are covered in depth in the Gutenberg Theme Development Course. Hopefully that will help!
August 27, 2018 at 10:13 pm in reply to: Extending on the topic of the Custom Toolbar example. #55640Zac Gordon
KeymasterMy understanding is core blocks are not meant to be imported into custom blocks.
But you can look at how that core block was built and rebuild it in your block.
If you want to group together blocks, you might want to use reusable blocks or block templates or even nested blocks. The nested blocks approach might work.
Zac Gordon
KeymasterHmm that I’m not too sure about. Would you mind asking in the WordPress #core-editor Slack channel and let us know what you find?
Zac Gordon
KeymasterZac Gordon
KeymasterDoes
getEditWrapperProps()
do the job?Here is an example of it in use https://github.com/zgordon/gutenberg-course/blob/master/blocks/04-block-alignment-toolbar/index.js
Zac Gordon
KeymasterThanks! Went through and updated all the links 🙂
August 21, 2018 at 4:15 pm in reply to: "Found 25 vulnerabilities" after running "npm install" in Atom #55211Zac Gordon
KeymasterYeah, I have removed package-lock.json from the files. Was causing some other issues too.
Zac Gordon
KeymasterJust updated the npm script to minify in production. Just needed -p at the end 🙂
"build": "cross-env BABEL_ENV=default NODE_ENV=production webpack -p"
Zac Gordon
KeymasterHi!
Is the webpack setup included in the example plugin not giving you minified files when you run
npm run build
?August 15, 2018 at 2:37 pm in reply to: Extending on the topic of the Custom Toolbar example. #54811Zac Gordon
KeymasterHere is the current location of the core blocks 🙂
https://github.com/WordPress/gutenberg/tree/master/packages/block-library/src
Zac Gordon
KeymasterSo webpack is taking all of your JS and CSS and compiling them into a few files in your assets folder. So, you will need all of the compiled files for sure. Likely the only files you do not need are the ones in the blocks folder.
To know for certain, look at what css and JS files the plugin enqueues and include them.
Hope that helps 🙂
—
In the future could you please open new forum threads if you have different questions so they’re easier to find and keep track of. Thanks!Zac Gordon
KeymasterI don’t have a full checklist of what to change but that is exactly the idea 👍🏼
Zac Gordon
KeymasterHi!
All you need is the final file that webpack exports. This is all covered in the course, but let me know once you’re done if it doesn’t make sense 🙂
Also yes, you can use the course plugin as a starting point for future projects.
Yup, I have a course on Advanced Gutenberg planned for the end of the year 🙂
Zac Gordon
KeymasterGlad you got it all sorted! Not sure if you’re still having problems, but let me know if you do.
The error of making changes to an existing block is standard behavior. Annoying, but standard.
August 3, 2018 at 2:02 pm in reply to: Display div If toggleControl attribute set to true conditional #53878Zac Gordon
KeymasterOkay so if you want to control what is displayed on the frontend that is controlled in the save setting since that is what is saved in the database and displayed on the frontend.
You can either use classnames to control display via CSS or use a conditional to not even load the component if toggle is enabled.
Here is some help with JSX conditionals if you need 🙂
https://reactjs.org/docs/conditional-rendering.html
Hopefully that should solve the problem! Let me know if not 🙂
Zac Gordon
KeymasterAhahahahaha 🤣
Glad could be a help and not remember ;p
Post up again if you get stuck with anything else 🙂
Zac Gordon
KeymasterSee that’s the trick. You can refer to them by name for the icon parameter.
I remember exploring how to add them to your own svg and went with custom ones at the time instead.
This may be a good question to ask in #core-editor Slack channel and see what they say.
-
AuthorPosts