Skip to content

collective/volto-subsites

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

volto-subsites

Volto addon to manage subsites

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

Created with voltocli.

Usage

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.subsite?.data,
}))(Header);

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 6