Introducing the Wix Blog Post Page API!

We’re thrilled to announce that the Post Page Client API for Corvid is now available to all users!

What can you do with it?

  • Customize the design of your post page - add hero image, change the location of the metadata (date, category, etc). Check out the screenshot below!

  • Customize your post page with new widgets - related posts, related products/services, etc.

  • Add new functionality to your post page - anonymous comments widget, reactions widgets and more.

You can find the documentation here . Coding examples can be found here .

Share your work with us, we’d love to see!

Hi! I have a question. I created a dynamic posts page. Now I am trying to connect a text block to the database. But text formatting is not saved? Is that right?

Hi!
The API described in this post allows you to customize the post page itself. You don’t need to create dynamic pages, you can use the internal page of the blog which called “Post” and customize it using the API. (this is what was done in the screenshot above).

Please contact me if you have any further questions :slight_smile:

@maya-ekron Hi, thanks! I looked at the API. Tell me, what value should I add instead of “myPostPage”?

$w('#myPostPage').getPost()

https://www.wix.com/corvid/reference/$w.PostPage.html#getPost

@eugene-m Hi, you should pass the name of the post page element (by default it is “post1”).

@maya-ekron Hi again! Thanks for your help, it works :slight_smile:
But I got the problem.

I changed the post page. I use the page title that I get using getPost. I also added post navigation. When I open a post for the first time - OK, the title gets the value. But if I use navigation inside the post, the title does not update its value. The post page does not reload?

My site and post
(only for desktop)

@eugene-m Hi, check out this piece of code:

import wixLocation from 'wix-location'

async function setPostTitle() {
 let postData = await $w('#post1').getPost();
 let postTitle = postData.title;
 $w('#postTitle').text = postTitle;
}

$w.onReady(function () {
 try {
        setPostTitle();
    } catch (error) {
        console.log(error);
    }

    wixLocation.onChange(async (location) => {
 try {
            setPostTitle();
        } catch (error) {
            console.log(error);
        }
    })
});

You need to do the action of changing the post twice - when the page loads and when navigating to another post (the second one you achieve using wixLocation.onChange).

Please let me know if you have any other questions.

@maya-ekron Thanks for the quick response! Your code works for me.
I also find this solution pretty performance.

Hi, how do i achieve a post title and image cover like the one posted above? is there an example page I can use?

Sure, check out the examples here .

@Maya Ekron Would there be anyway to chat with you in regards to an idea and functionality that the Blog API has?

Excellent. We’ve been waiting for this feature and are excited to try it.

@maya-ekron So is it not possible to connect the text block in the database and keep the formatting? Or is it that if I want thee nice formatting it can’t create my own dynamic page, I have to use the original post page?

Correct, it is not possible to bind a text block to the data and keep the formation, therefore if you want to have your own design you must use the existing post page with the post page API.

Does this mean I can feed an outside blog feed using their API? My client wants to feed her Keeping Current Matters feed onto her Wix blog. See documentation here: https://support.bombbomb.com/hc/en-us/articles/115000430591-How-do-I-set-up-my-Keeping-Current-Matters-integration-

Hi, Apologise for late response. No, this API will not allow you feed external content to the Wix Blog.

Is it possible to access this API through a REST interface? I would like to automatically add/update forum topics with data from another site. Please let me know if this is possible and if any examples of this exist anywhere?

Hi Arthur,
getPost() is a read only function, which can be accessed only from Corvid and can be used only in Blog post page. Unfortunately, updating or creating posts is not possible at the moment.