This is the live site, and right now there are a couple more things that need to be addressed before we can call things finished. One of those things can be seen very plainly when I refresh the page. Now keep your eye on the microwave card. Here I go, refreshing in three, two, one.
Notice how the microwave card blinks in after everything else is already painted to the page. That's an issue we'll fix in the next lesson. But in this lesson, let's take care of the fact that the microwave is even showing up at all. What do I mean?
Well, if we go back over into our Storyblock interface, you'll see that right now the only two projects that are published are the food picker upper sticks and the toast maker. The microwave is in fact still in draft mode, and certainly we don't want to be displaying drafts on our public site. So what can we do about this? Well, Let's once again take advantage of those special query parameters that StoryBlock adds when we're inside of the editor.
view, instead of asking just for the draft as my version here, instead I'll check for the existence of the underscore StoryBlock query parameter on the route. And then only if that exists do we request the draft. And if it doesn't exist, that is for everything outside of the editor, we'll request the published stories. That should do it.
I'll get my site deployed and we'll check things out back here in just a moment. After pausing the video and letting my site deploy, here I am back on the live site. And sure enough, you can see that the microwave is now gone from our list of featured projects. If we head over to the Storyblock editor though, you'll see that the microwave is right where it should be for our editors.
Perfect. So this works great for the home page. Now let's just do the same exact thing for the projects pages. We won't deploy this again together in the video.
I'll just let you test this piece on your own. This is the live site, and right now there are a couple more things that need to be addressed before we can call things finished. One of those things can be seen very plainly when I refresh the page. Now keep your eye on the microwave card.
Here I go, refreshing in three, two, one. Notice how the microwave card blinks in after everything else is already painted to the page. That's an issue we'll fix in the next lesson. But in this lesson, let's take care of the fact that the microwave is even showing up at all.
What do I mean? Well, if we go back over into our Storyblock interface, you'll see that right now the only two projects that are published are the food picker upper sticks and the toast maker. The microwave is in fact still in draft mode, and certainly we don't want to be displaying drafts on our public site. So what can we do about this?
Well, Let's once again take advantage of those special query parameters that StoryBlock adds when we're inside of the editor. view, instead of asking just for the draft as my version here, instead I'll check for the existence of the underscore StoryBlock query parameter on the route. And then only if that exists do we request the draft. And if it doesn't exist, that is for everything outside of the editor, we'll request the published stories.
That should do it. I'll get my site deployed and we'll check things out back here in just a moment. After pausing the video and letting my site deploy, here I am back on the live site. And sure enough, you can see that the microwave is now gone from our list of featured projects.
If we head over to the Storyblock editor though, you'll see that the microwave is right where it should be for our editors. Perfect. So this works great for the home page. Now let's just do the same exact thing for the projects pages.
We won't deploy this again together in the video. I'll just let you test this piece on your own.