4.0.0 • Published 2 years ago

volto-subsites v4.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

volto-subsites

Volto addon to manage subsites.
Intended to be used with collective.volto.subsites.

To be used with mrs-developer, see Volto docs for further usage informations.

Created with voltocli.

Usage

If you're using Volto < 12, then use v1.1.0

If you're using Volto < 16, then use v3.0.4

Simply load the addon in your project.

Put wherever you want. This component loads the config for subsite and add subsite classes to body. Suggest component where to put the subsite loader is the customized AppExtras component from volto.

Get subsite data from the redux state in your components. For example:

import React from 'React';
import { connect } from 'react-redux';
import { SubsiteLoader } from 'volto-subsites';

const AppExtras = ({ pathname }) => {
  return (
    <>
      <SubsiteLoader pathname={pathname} />
    </>
  );
};

export default connect(
  (state, props) => ({
    pathname: props.location?.pathname,
  }),
  {},
)(AppExtras);
class Header extends Component {
  //...
  render() {
    return (
      <>
        //...
        {this.props.subsite?.title}
      </>
    );
  }
}
export default connect(state => ({
  token: state.userSession.token,
  subsite: state.content?.data?.['@components']?.subsite;
}))(Header);
4.0.0

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.1.2

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.5

2 years ago

2.1.1

2 years ago

2.1.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago