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

Body Not Rendering #12

Closed
robwelan opened this issue Jan 8, 2018 · 26 comments
Closed

Body Not Rendering #12

robwelan opened this issue Jan 8, 2018 · 26 comments

Comments

@robwelan
Copy link

robwelan commented Jan 8, 2018

On OSX, I have loaded the starter into a MAMP [v4.2.1 (852)] instance. I have run 'npm run watch' and also 'npm run production'. In both cases, the 'header' and 'footer' render, but the body does not. Suggestions? I have fixed a minor issue with the API route (I was getting 404 errors, but I fixed this with a small edit to the app.js (I removed the leading '/'). Calling the api directly from the browser URL works fine (in my case it is 'http://localhost:8888/development-vue/wp-json/wp/v2/categories?sort=name&hide_empty=true&per_page=50').

@raisiqueira
Copy link

Hi, @robwelan. How are your permanent links? If you are using de WordPress default, change to any other permalink.

@robwelan
Copy link
Author

robwelan commented Jan 9, 2018

I've cycled through all permalink options except for custom. No change unfortunately. In case this helps, this is the html that is rendered between the header and footer sections:
<div class="page-content-wrapper"><!----></div>

@robwelan
Copy link
Author

robwelan commented Jan 9, 2018

I've worked out that adding '/development-vue' to my 'base' route (line 19 in index.js in the router folder) helps, as well as making sure 'plain' is not the chosen permalink. I've created a helper file to get window.location.pathname and I have added the result to router/index.js (modifying 'base' value) and also app.js modifying API_BASE_PATH). Working OK on MAMP.

@raisiqueira
Copy link

So it worked? 🤔

@robwelan
Copy link
Author

Yes, with the change I've described (adding window.location.pathname if it does not equal to '' on the router/index.js and the app.js files)

@raisiqueira
Copy link

Close issue, please 😄

@EvanAgee
Copy link
Owner

Thanks so much @raisiqueira for helping out! +1 to awesomeness for you!

@Ivanok
Copy link

Ivanok commented Feb 25, 2018

Hello, I'm trying to use the starter theme but i'm not able to render the body either.

Specifically, When I open the example Home page, the lists of pages and posts are not rendering on the page.

I tried making the changes as stated above, but the list of posts is still not rendering. I am able to access the api via browser so I'm not sure what is going on.

Thank you for making the starter theme and I hope that you'll be able to help me!

@wester97
Copy link
Collaborator

wester97 commented Feb 25, 2018 via email

@Ivanok
Copy link

Ivanok commented Feb 25, 2018

No console errors.

@wester97
Copy link
Collaborator

wester97 commented Feb 25, 2018 via email

@Ivanok
Copy link

Ivanok commented Feb 25, 2018

There is no 404 at all.

@wester97
Copy link
Collaborator

wester97 commented Feb 25, 2018 via email

@Ivanok
Copy link

Ivanok commented Feb 25, 2018

I don't see the posts requests on the list at all.

I did another clean installation of the theme files to ensure that I didn't make any changes. Attached is a screenshot of the network requests.

vue wp requests

@wester97
Copy link
Collaborator

wester97 commented Feb 26, 2018 via email

@Ivanok
Copy link

Ivanok commented Feb 26, 2018

@wester97 I uploaded the wrong attachment and changed it on the previous comment, am just now realizing that since you're responding via email that change did not get to you. Here is the correct attachment:

image

Thank you for the help.

@wester97
Copy link
Collaborator

Hmm, it seems that your requests for pages and posts aren't actually fired.

Do you see the placeholders for these sections on the homepage? For example: Home.vue loads pages-widget which ultimately should load the results of getPages into the data store, and thus into the view. You might have to trace that flow.

@wester97
Copy link
Collaborator

Hmm, please pull master and try again.

@Ivanok
Copy link

Ivanok commented Feb 26, 2018

It works perfectly now!

Thank you.

@dedanirungu
Copy link

dedanirungu commented Nov 21, 2018

I've worked out that adding '/development-vue' to my 'base' route (line 19 in index.js in the router folder) helps, as well as making sure 'plain' is not the chosen permalink. I've created a helper file to get window.location.pathname and I have added the result to router/index.js (modifying 'base' value) and also app.js modifying API_BASE_PATH). Working OK on MAMP.

I am having the same issue while trying to load pages. All pages are blank and only shows
<div class="page-content-wrapper"><!----></div>.

I have tried to follow the solution attached but I did not understand which files need to be changed.

@robwelan Kindly assist me with the steps guide on how to solve the issue.

@EvanAgee EvanAgee reopened this Nov 21, 2018
@dedanirungu
Copy link

dedanirungu commented Nov 24, 2018

Thank you @EvanAgee for reopening the issue.

Did you manage to get a solution on the issue. I have tried everything on my side and I did not manage to solve it. All route-view are rendering an empty div as shown below.

<div class="page-content-wrapper"><!----></div>

I will highly appreciate for your assistance.

@joshbedo
Copy link

Just downloaded the project and also having the same problem. I checked the network request and the API calls are returning the correct data and look fine but for some reason the body isn't rendering for posts/pages or home. I tried adding debugger in a few of the lifecycle methods but it wasn't getting hit not sure whats going on.

@joshbedo
Copy link

So i figured it out, i had the wordpress installation in a subdirectory and it messed up not only the api routing ( had to change API_BASE_NAME ) and it messed up the other routing. Just reinstalled it in the main htdocs directory for mamp and everything appears to be working fine now.

@EvanAgee
Copy link
Owner

Thanks so much @joshbedo for tracking that down. I should note in the README that this project only works for root-level WP installs.

@joshbedo
Copy link

@EvanAgee no problem, yeah it would be cool if we could use subdirectories not sure what would be involved to make that happen.

@EvanAgee
Copy link
Owner

EvanAgee commented Feb 5, 2019

I've just released an updated version of the project that will address many of these issues. Please note that the paths of the JS and CSS have changed so you may need to update your project. #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants