Forum Replies Created

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • in reply to: Add style format select in richtext toolbar #134535
    ldecoker
    Participant

    Hi Zac,

    That was indeed the documentation I used but this would add a single button to the paragraph block. I have several formatting option and would like to add it in a select. Do you know if this is possible?

    thx!

    in reply to: Add style format select in richtext toolbar #134403
    ldecoker
    Participant

    Hello Zac,

    Text in paragraph block. For example, by selecting a portion of the text and applying a class (in a span tag for example). Then with css, I can do whatever I want as style (color, font, icon, ..)

    in reply to: render() function in component class error #117538
    ldecoker
    Participant

    Indeed this was a missing babel config. I forgot to install the “@wordpress/babel-preset-default”.

    thx !!

    in reply to: Broken gallery block – Advanced Gutenberg Course #90795
    ldecoker
    Participant

    Hello!

    I used the ones from your advanced course.

    Have a nice day!

    in reply to: Broken gallery block – Advanced Gutenberg Course #90559
    ldecoker
    Participant

    Hello!

    The errors I’ve got came from this code (from github):

    const onSelectImages = newImages => {
          const images = newImages.map(img =>
            Object.assign(
              {},
              {
                src: img.sizes.large.url,
                width: img.sizes.large.width,
                height: img.sizes.large.height,
                id: img.sizes.large.id,
                alt: img.sizes.large.alt,
                caption: img.sizes.large.caption
              }
            )
          );
          setAttributes({ images });
        };

    First I had to change large by full and then for the id/alt/caption field, you need to remove the sizes.large part.

    Have a nice day!

    in reply to: Meta data – default value #87496
    ldecoker
    Participant

    okidoki. I will keep you informed about their answer.

    have a nice day!

    in reply to: Meta data – default value #87468
    ldecoker
    Participant

    Sorry to not be so clear 🙂
    When I load a default value and save the post, it does not save the default value to meta but the value is present in the POST request.

    POST request URL:
    /wp-json/wp/v2/pages/62?_locale=user

    POST request meta section:

    meta {
    blocks_identifier: "home"
    }

    When checking the database, in postmeta, the meta has not been added.
    Hope this is more clear.

    Thx!

    in reply to: Meta data – default value #87329
    ldecoker
    Participant

    Thx Zac, but looking in the POST request, I can see that the attribute has a value : the default one. So I do not understand why it’s not saved in database.

    in reply to: Add MediaUpload/MediaUploadCheck in sidebar #84473
    ldecoker
    Participant

    Thx! I am attending the training right now. I did not see it was available now 🙂

    in reply to: Add MediaUpload/MediaUploadCheck in sidebar #84468
    ldecoker
    Participant

    Thx Zac!

    yes I have the advanced GB course on my dashboard 🙂

    in reply to: Override component ? #60820
    ldecoker
    Participant

    Thx for your answer!

    in reply to: Using jQuery in frontend.js #60746
    ldecoker
    Participant

    Sorry my mistake. It was only missing the jquery dependency when enqueuing my frontend js.

    in reply to: Plugin path in index.js file #60716
    ldecoker
    Participant

    Thx Zac.

    Hereunder what I have done to solve my issue (not sure this is the best solution but it works):

    npm i react-svg-core --save-dev
    npm i react-svg-loader --save-dev

    Then in webpack.config.js (in module.exports):

    externals: {
    		react: {
    			root: 'React',
    			commonjs: 'react',
    			commonjs2: 'react',
    			amd: 'react'
    		}
    	},
    

    and in rules:

    {
    				test: /\.svg$/,
    				use: [
    					{
    						loader: "babel-loader"
    					},
    					{
    						loader: "react-svg-loader",
    						options: {
    							jsx: true // true outputs JSX tags
    						}
    					}
    				]
    			}

    Finally in index.js :
    import ArrowBottom from '../../assets/images/arrow-bottom.svg';

    and where you want to add your icon:
    <ArrowBottom />

    Do not hesitate to comment 🙂

    Have a nice day!

Viewing 13 posts - 1 through 13 (of 13 total)