Forum Replies Created

Viewing 25 posts - 201 through 225 (of 475 total)
  • Author
    Posts
  • in reply to: How can I define the width of the editor? #44702
    Zac Gordon
    Keymaster

    Great! Thanks for sharing this back up 🙂

    in reply to: Error in #44700
    Zac Gordon
    Keymaster

    When you return elements in React they have to be wrapped inside a single element. So you can either take your elements and wrap in a div or import Fragment from wp.element and wrap it in a component.

    Hope that helps!

    in reply to: Code Editor #44698
    Zac Gordon
    Keymaster

    Okay so I may still not be following everything completely, but couldn’t you add the attribute you need to the save function as a data attribute or class?

    I’m also curious what happens when you use the CodeEditor component in the save method (I haven’t experimented with it yet).

    Not sure if it relates, but blocks were not designed to be interactive on the frontend. So if you want a block to have JS run on the frontend you do need to load it separately in a script loaded to the frontend like you’re describing.

    Hope this helps a bit? Let me know how the experimentation goes!

    in reply to: Code Editor #44663
    Zac Gordon
    Keymaster

    Could you use a selector like a radio button in the inspector control that let’s you assign the type of code block on the backend? Then I’m guessing some class or something passed as from an attribute could let the frontend know the kind of code you’re working with. Would that work or address the problem?

    in reply to: React error after updating to Gutenberg 2.6.0 #44630
    Zac Gordon
    Keymaster

    Hey Raquel!

    Is this for the updated example files or for some of your own custom blocks?

    This is a pretty general error which usually means something isn’t being returned as a proper element or you’re trying to return two elements instead of one.

    You should hopefully get a file name and line associated with the error.

    Let me know!

    in reply to: How can I define the width of the editor? #44609
    Zac Gordon
    Keymaster

    Good question. I haven’t seen anything about this as I believe the editor is designed to be responsive so I’m not sure if hardcoding the width of it would be a good idea in all contexts. I haven’t tried it but can you just apply some custom CSS to one of the main editor wrappers?

    in reply to: Gutenberg Development Course Video Not Displaying #44564
    Zac Gordon
    Keymaster

    Heyo! Way to go Alan! Hope the course was helpful 🙂 Congrats on and good luck with your Gutenberging!

    in reply to: Gutenberg Development Course Video Not Displaying #44504
    Zac Gordon
    Keymaster

    So weird! Was up before! All fixed now 🙂

    in reply to: Broken inspector fields block #44354
    Zac Gordon
    Keymaster

    And you deleted the old plugin and installed the new one with this update?

    https://github.com/zgordon/gutenberg-course/blob/master/jsforwp-example-blocks/blocks/07-inspector-control-fields/index.js#L17-L27

    It is working from my end although I was able to duplicate the first issue you raised before the patch.

    in reply to: Broken inspector fields block #44346
    Zac Gordon
    Keymaster

    Okay, should work now (check the updated repo files)! Sorry about that!

    Please let me know if you still have troubles.

    in reply to: Broken inspector fields block #44341
    Zac Gordon
    Keymaster

    Thanks Eric! Fixing now..

    in reply to: Wrong video for Gutenberg course 01.06 #44301
    Zac Gordon
    Keymaster

    Great catch! Have the correct video re-uploading now 🙂

    in reply to: Can't see any course material #44107
    Zac Gordon
    Keymaster

    Huh, weird. Just added the course for you manually again. Should work now! Sorry for the bugginess :O

    in reply to: Can't see any course material #44094
    Zac Gordon
    Keymaster

    Hey Dominik! Sorry about the trouble you should be all set now!

    in reply to: Creating filter function loop #43508
    Zac Gordon
    Keymaster

    Hi Angie!

    Will the normal .sort() work?

    Zac Gordon
    Keymaster

    I believe that one is just because Editable changed its name to RichText. Some other small things like focus has changed to isSelected as well.

    Will get those up as soon as can 🙂

    Zac Gordon
    Keymaster

    I believe that one is just because Editable changed its name to RichText. Some other small things like focus has changed to isSelected as well.

    Will get those up as soon as can 🙂

    Zac Gordon
    Keymaster

    Yes! Good catch. Sorry about that.

    Editable changing to RichText and some other updates have occurred and are no longer supported.

    I am starting this week to begin redoing all the examples and re-recording the course to include the updates 🙂

    in reply to: Title Setting Not Changing #42830
    Zac Gordon
    Keymaster

    Hi Sally,

    Let’s try this to troubleshoot:

    1. Download the repo – https://github.com/zgordon/gutenberg-course/archive/master.zip
    2. Open it in the command line
    3. Run npm install
    4. Run npm run dev
    5. Open a JS file in the /blocks/examples and make a change to it
    6. The command line should update

    You don’t have to install this as a plugin and test it, just want to see exactly where the problem is happening for you.

    in reply to: Media Upload Button #42402
    Zac Gordon
    Keymaster

    You are correct my friend! Thanks for posting this up 🙂

    Hoping to make an update to the course with this soon, but so many changes still happening. Will link to this forum post from the video though 🙂

    in reply to: Warnings/Errors on npm install and npm run dev #42400
    Zac Gordon
    Keymaster

    Oh Yay!

    – FIRST So proud of you!!! This is no small thing getting tools like this up and running and you deserve some recognition here for working through all this 🙂 Congrats 🙂

    – That is WEIRD about the NODE_ENV thing. Hopefully you should not need to uninstall Atom or do major reboots to have everything work going forward.

    Please post back up in this thread if you have the same issues or a new one if anything different comes up for you 🙂

    in reply to: Warnings/Errors on npm install and npm run dev #42378
    Zac Gordon
    Keymaster

    Okay, great! This is a step in the right direction.

    1. Good
    2. Okay, so if you delete the node_modules folder and just run npm init in the plugin folder, what specific errors do you get?
    3. NODE_ENV is being set automatically for you when you run npm run dev or npm run build. You should not need to set NODE_ENV manually. See these commands here? How they set that for you – https://github.com/zgordon/gutenberg-course/blob/master/jsforwp-blocks/package.json#L4-L5

    Two followup questions:

    4. Where are you hard coding the value of NODE_ENV?
    5. When you run “npm run dev” and change something in the JS, does the file rebundle and show up properly in WordPress?

    in reply to: Warnings/Errors on npm install and npm run dev #42332
    Zac Gordon
    Keymaster

    Hi @ccziriak!

    Sorry I missed that you posted up your specific errors here!

    Okay so this is basically saying that the cross-env library is not being loaded.

    To start troubleshooting this let’s

    1. Make sure that the cross-env package is listed in your package.json file. It should be by default.
    2. Manually delete the node_modules folder in the jsforwp-blocks folder and try running npm install again.
    3. This should make sure that cross-env is loaded.

    Let me know the results and we’ll go from there..

    in reply to: Title Setting Not Changing #42283
    Zac Gordon
    Keymaster

    Hi Sally!

    The reason is that the plugin pulls in a compiled version of all the other JavaScript files. This is so that we can use things like imports and JSX and other JavaScript features that might not be supported in browsers.

    It is an extra step, but does provide a lot of benefits that make it worth it 🙂

    Hope that helps! Let me know how the config process goes!

    in reply to: Title Setting Not Changing #42243
    Zac Gordon
    Keymaster

    Hi Sally!

    Okay, this sounds like a problem getting setup with the build tools:

    – Make sure you’re working with the plugin inside your /wp-content/plugins folder
    – You will want to run npm install in the main folder with the package.json file in it
    – If you want to edit the files, the best thing to do is run npm run dev first (npm run build is more meant for when you are done and want to run the build one final time)

    If you have errors from running any of these commands, please post them up and we’ll get you up and running.

Viewing 25 posts - 201 through 225 (of 475 total)