Skip to content

Update Weather Block for volto customisation training 2025#977

Merged
sneridagh merged 10 commits intomainfrom
volto-customisation-2025-weather-block
Oct 13, 2025
Merged

Update Weather Block for volto customisation training 2025#977
sneridagh merged 10 commits intomainfrom
volto-customisation-2025-weather-block

Conversation

@Tishasoumya-02
Copy link
Copy Markdown
Contributor

@Tishasoumya-02 Tishasoumya-02 commented Oct 7, 2025

  • I have granted permission to publish my contribution according to Granting permission to publish.
    Minor typographical corrections and other contributions that are not "material in nature" are exempt from this requirement.
  • I followed the guidelines in Contributing to Plone Training.
  • I verified there aren't any other open pull requests for the same change.
  • I successfully built the documentation and ran quality checks on my changes locally according to Building and Checking the Quality of Documentation.
  • If needed, I added new terms to the Glossary file glossary.md and referenced them in the documentation. Note that terms that are defined in external Sphinx documentation, including Plone 6 documentation, may be referenced with a {term} directive without adding the definition to the local glossary.md file.

If your pull request closes an open issue, include the exact text below, immediately followed by the issue number.
When your pull request gets merged, then that issue will close automatically.

Closes #


📚 Documentation preview 📚: https://plone-training--977.org.readthedocs.build/

Comment thread docs/volto-customization/custom_block.md Outdated
@iFlameing
Copy link
Copy Markdown
Member

@Tishasoumya-02 any progress regarding this.

@iFlameing
Copy link
Copy Markdown
Member

iFlameing commented Oct 11, 2025

@Tishasoumya-02 can you please update this line

We need to configure the project to make it aware of a new block by adding it to the object configuration that is located in {file}src/index.js. For that we need the two blocks components we created and a SVG icon that will be displayed in the blocks chooser.

src/index.js to config/blocks.ts and then put this code here. since we migrate to new setup.

import type { ConfigType } from '@plone/registry';
import WeatherEdit from 'volto-teaser-tutorial/components/Blocks/Weather/Edit';
import WeatherView from 'volto-teaser-tutorial/components/Blocks/Weather/View';
import worldSVG from '@plone/volto/icons/world.svg';

export default function install(config: ConfigType) {
  config.blocks.blocksConfig.weather = {
    id: 'weather',
    title: 'Weather',
    icon: worldSVG,
    group: 'common',
    edit: WeatherEdit,
    view: WeatherView,
    restricted: false,
    mostUsed: false,
    sidebarTab: 1,
  };

  return config;
}

and in css for .hourly-forecast

put flex-flow: wrap. so that is look nice in edit view. maybe you can also come with nice css. I just went throught it and tried to fix it.

@Tishasoumya-02
Copy link
Copy Markdown
Contributor Author

Tishasoumya-02 commented Oct 11, 2025

config/blocks.ts

Do I also need to add code for index.ts ?
(edit) added code for index.ts and updated the css, I think flex-flow:wrap will be good enough for now

Copy link
Copy Markdown
Member

@iFlameing iFlameing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-project-automation github-project-automation Bot moved this from New to Approved in Plone Documentation Oct 12, 2025
@sneridagh sneridagh merged commit 9e71be9 into main Oct 13, 2025
3 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in Plone Documentation Oct 13, 2025
@sneridagh sneridagh deleted the volto-customisation-2025-weather-block branch October 13, 2025 08:04
@stevepiercy
Copy link
Copy Markdown
Contributor

Sorry, I didn't have time to give this a thorough review before the training.

I would suggest that you perform the following checks to make sure you don't have any glaring errors or warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants