Forum Replies Created
-
AuthorPosts
-
ldecokerParticipant
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!
ldecokerParticipantHello 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, ..)
ldecokerParticipantIndeed this was a missing babel config. I forgot to install the “@wordpress/babel-preset-default”.
thx !!
ldecokerParticipantHello!
I used the ones from your advanced course.
Have a nice day!
ldecokerParticipantHello!
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!
ldecokerParticipantokidoki. I will keep you informed about their answer.
have a nice day!
ldecokerParticipantSorry 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!
ldecokerParticipantThx 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.
ldecokerParticipantThx! I am attending the training right now. I did not see it was available now 🙂
ldecokerParticipantThx Zac!
yes I have the advanced GB course on my dashboard 🙂
ldecokerParticipantThx for your answer!
ldecokerParticipantSorry my mistake. It was only missing the jquery dependency when enqueuing my frontend js.
ldecokerParticipantThx 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!
-
AuthorPosts