1

I have created one Static block with added below content in and I need to add social links in PWA.

<a class="footer-facebook" href="https://www.facebook.com/" target="_blank" rel="noopener">Facebook</a>

Above code is not working anyone have idea how to add URL in PWA ?

Anas Mansuri
2,6371 gold badge12 silver badges29 bronze badges
asked Sep 16, 2019 at 9:58

1 Answer 1

2

Right now there isn't just one way to set up a custom theme in PWA studio, so i'm going to show the core files as of 3.0 for an answer to the question.

In the footer file add in this code:

src/pwa-studio/packages/venia-concept/src/components/Footer/footer.js

import CmsBlock from '../CmsBlock';
render() {
 ...
 return (
 <footer className={classes.root}>
 ...
 <CmsBlock identifiers={'cms-block-name'} />
 ...
 </footer>
 )
}

This will pull in your cms by it's name into the react component. You can place the component anywhere inside the return statement. If you need to add styling to the component, i would recommend wrapping it and setting a className on the wrapper.

answered Sep 19, 2019 at 13:56
3
  • My question is how can I add Social link in static block in PWA Commented Sep 20, 2019 at 11:33
  • Are you looking to add a link to a cms block? you just have to log into the admin and add it there under content > blocks. Once you have created the block, you can use the code above to have the cms block show inside the footer component (you can use this same method in any other component as well) Commented Sep 20, 2019 at 13:27
  • I did same thing but changes not reflaced. I executed command also : yarn run watch:venia But it's not update changes. Commented May 11, 2021 at 12:11

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.