Skip to content
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

feat: Add option to inject dynamic template component #2

Open
DominicBoettger opened this issue Oct 23, 2019 · 0 comments
Open

feat: Add option to inject dynamic template component #2

DominicBoettger opened this issue Oct 23, 2019 · 0 comments
Labels
enhancement New feature or request hacktoberfest

Comments

@DominicBoettger
Copy link
Member

DominicBoettger commented Oct 23, 2019

It should be possible to add a page template or to fall back to a default one.

Currently there is only some default set which renders the header informations and a default set of components into the html body.

The template should itself be webcomponent.

The current render function in the site loader:

render() {
    // should stay here to remove old headers
    this.renderHeader();
    this.renderHtmlLangTag();
    if (this.data && this.data.data) {
      const output = [];
      if (this.data.menu && this.data.menu.main) {
        output.push(<il-menu-main data={this.data.menu.main}></il-menu-main>);
      }
      this.data.data.map(item => {
        output.push(this.renderItems(item));
      });
      if (this.data.menu && this.data.menu.footer) {
        output.push(<il-menu-footer data={this.data.menu.footer}></il-menu-footer>);
      }
      return (
        <Host>
          {output.map(out => {
            return out;
          })}
        </Host>
      );
    }
  }
@DominicBoettger DominicBoettger added hacktoberfest enhancement New feature or request labels Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

No branches or pull requests

1 participant