-
-
Notifications
You must be signed in to change notification settings - Fork 714
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
Block examples documentation #6560
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for plone-components canceled.
|
Thank you for writing this @erral . It's awesome when an experienced Volto developer takes some time to pass on some of this hard-earned experience and writes some documentation. You are awesome for doing this. I plan on giving it a read sometime this week to see if there is anything that I can help with in potential suggestions. But again, thank you for doing this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great stuff. Thank you!
I created a related PR to define Glossary terms at plone/documentation#1829, which needs to be merged before this PR to pull them into this PR's docs preview.
|
||
customschemaandview | ||
customviewandvariations | ||
customviewvariationsandschemaenhancer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename all the above files with dashes between words to improve SEO.
--- | ||
myst: | ||
html_meta: | ||
"description": "Volto block examples." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "Volto block examples." | |
"description": "Volto block examples" |
myst: | ||
html_meta: | ||
"description": "Volto block examples." | ||
"property=og:description": "Volto block examples." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"property=og:description": "Volto block examples." | |
"property=og:description": "Volto block examples" |
html_meta: | ||
"description": "Volto block examples." | ||
"property=og:description": "Volto block examples." | ||
"property=og:title": "Block examples" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"property=og:title": "Block examples" | |
"property=og:title": "Volto block examples" |
"keywords": "Volto, React, blocks, example, edit, view, Plone" | ||
--- | ||
|
||
# Volto Block examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Volto Block examples | |
# Volto block examples |
|
||
With all the block components ready, you need to register the block into Volto. | ||
|
||
To do so, open your addon's {file}`index.js` file, that will have the following contents: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do so, open your addon's {file}`index.js` file, that will have the following contents: | |
To do so, open your add-on's {file}`index.js` file, and add the following contents. |
export default applyConfig; | ||
``` | ||
|
||
And before the last `return config;` statement, write the following configuration: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And before the last `return config;` statement, write the following configuration: | |
Before the last `return config;` statement, write the following configuration. |
}, | ||
], | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
``` | ||
|
||
On the top of the file you will need to import the relevant components, as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the top of the file you will need to import the relevant components, as follows: | |
At the top of the file, import the relevant components as follows. |
|
||
Your block is ready to be used in your site. | ||
|
||
Restart your Volto site and you will be able to add it using the block add form. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restart your Volto site and you will be able to add it using the block add form. | |
Restart your Volto site, and you can add it using the block add form. |
@erral once you apply @stevepiercy suggestions and you feel that the work is ready for review you can add me as a reviewer if you would like, I volunteer to read the docs and give any potential suggestions if needed. |
I have reviewed the block documentation, converted some code blocks from class components to functional components, and provide an example of a simple block.
📚 Documentation preview 📚: https://volto--6560.org.readthedocs.build/