macaw-cad / react-jss-typescript-starter

React Starter project for Sitecore JSS in TypeScript with frontend running in Node
21 stars 10 forks source link

Header menu editable in Experience Editor #62

Open umarmw opened 5 years ago

umarmw commented 5 years ago

Hello,

What is the best recommendation to change this

File: samples/react-typescript/src/Layout.tsx

     <NavLink to="/" className="p-2 text-dark">
        {t('Welcome')}
      </NavLink>
      <NavLink to="/umbrella" className="p-2 text-dark">
        {t('Umbrella')}
      </NavLink>
      <NavLink to="/scaffold" className="p-2 text-dark">
        {t('Scaffold')}
      </NavLink>
      <NavLink to="/styleguide" className="p-2 text-dark">
        {t('Styleguide')}
      </NavLink>
      <NavLink to="/graphql" className="p-2 text-dark">
        {t('GraphQL')}
      </NavLink>

to a dynamic version and which is also editable in the Experience editor?

svdoever commented 5 years ago

We followed the implementation of the Sitecore JSS React start example https://github.com/Sitecore/jss/blob/dev/samples/react/src/Layout.js. To make this dynamic depends on your requirements. You can create a navigation component powered by data in Sitecore items, see for example https://blog.vitaliitylyk.com/guide-on-refactoring-your-sitecore-solution-to-sitecore-jss/.