question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Routing not working properly with cmsData component

See original GitHub issue

Routing is not working properly with cmsData component.

I’ve configured the Snowdog CMS API module in Magento and got CMS pages as response successfully at Vue Storefront.

But, When I clicked on the CMS page link from another CMS page, It will not fetch CMS page content.

For example, When I clicked a first time on About Us link it will get whole page content from Magento and render it and then I clicked on another page from here. it will not be working.

I’ve set the router and its link as below:

Path: router/index.js

{ name: 'about-us', path: '/about-us', component: CmsData, props: {identifier: 'about-us', type: 'Page', sync: true} },
{ name: 'terms-conditions', path: '/terms-conditions', component: CmsData, props: {identifier: 'terms-conditions', type: 'Page', sync: true} },
{ name: 'privacy-policy', path: '/privacy-policy', component: CmsData, props: {identifier: 'privacy-policy', type: 'Page', sync: true} },
{ name: 'delivery-and-return-policy', path: '/delivery-and-return-policy', component: CmsData, props: {identifier: 'delivery-and-return-policy', type: 'Page', sync: true} }

Path: src/themes/default/components/core/blocks/Footer/Footer.vue

<router-link :to="localizedRoute('/about-us')" exact>
  {{ $t('About Us') }}
</router-link>
<router-link :to="localizedRoute('/terms-conditions')" exact>
  {{ $t('Terms & Conditions') }}
</router-link>
<router-link :to="localizedRoute('/privacy-policy')" exact>
  {{ $t('Privacy Policy') }}
</router-link>
<router-link :to="localizedRoute('/delivery-and-return-policy')" exact>
  {{ $t('Delivery and Return Policy') }}
</router-link>

Current behavior

When I click first time on a link it will fetch content properly from Magento and render it but when click on another link from here, it will not work.

2019_05_14_Selection_001

Expected behavior

It should be fetched page content for each link from Magento even clicked on another link from anywhere.

Can you handle fixing this bug by yourself?

  • YES
  • NO

Which Release Cycle state this refers to? Info for developer.

Pick one option.

  • This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
  • This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
  • This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

Environment details

  • Browser: Chrome
  • OS: Ubuntu 16.04
  • Node: v10.15.3
  • Code Version:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vishal-7037commented, May 20, 2019

@pkarw , Thank you. 👍 It works now 😃

1reaction
pkarwcommented, May 17, 2019

More on the CMS before and after VS 1.6: https://docs.vuestorefront.io/guide/data/static-data.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

Routing not working properly with cmsData component #2895
Routing is not working properly with cmsData component. I've configured the Snowdog CMS API module in Magento and got CMS pages as response ......
Read more >
Routing not working properly in angular 6 - Stack Overflow
I'm developing a small angular project with three components.Is that project I have a sub module called component ...
Read more >
Troubleshooting Angular routing - Medium
Putting routing configurations into a separate module has no technical meaning and is done for clearness and readability purposes only. The only missing...
Read more >
Common Routing Tasks - Angular
This topic describes how to implement many of the common tasks associated with adding the Angular router to your application.
Read more >
InDepth guide to passing data via routing - Angular Tutorials
Regarding the component code, we can split the problem into two parts: understanding in which mode the component is used and somehow storing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found