What did you mean by this?
“I have tested this example myself and have simply saved it so that I had access to all the datasets and the Blog displays properly.”
With a lot of the examples you can’t get access to the datasets, or in this case the Wix Blog post page was just displaying an error message, until you have saved the example yourself to your own account.
After you have saved the example the first time, plus I always close and re-enter my sites list, it will then show you the same example as before, howeever you will now have fulll access to datasets etc as they will now be on your control and not in Wix control like the example.
So, for the Extra Post dataset, the links were broken in the first field as I had broken the connection from Wix dataset when I saved it and they became my datasets.
Hence why I had to go back through and change all the links from broken back to the post, which you can see in this previous pic here.
As stated previously, you don’t want to be using cover photo and post title in the extra data dataset as those fields are already filled by the Wix Blog Posts collection fields themselves.
https://support.wix.com/en/corvid-by-wix/wix-blog-with-corvid
https://support.wix.com/en/article/corvid-wix-blog-posts-collection-fields#cover-image-coverimage
https://support.wix.com/en/article/corvid-wix-blog-posts-collection-fields#title-title
The Wix Blog Posts collections is read only.
Permissions
The Posts collection has the following permissions :
-
Read: Anyone
-
Create: None
-
Update: None
-
Delete: None
With yourself putting the post title and cover image fields into your extra post dataset as well, then you are trying to merge this extra data with the original Posts fields which will not work.
All you really need on your extra data dataset is the Post reference link field and the Author text field.
You would then just change the code here as such.
function assignPostDataToUIElements() {
$w("#postTitle").text = currentPost.title
$w("#authorName").text = `Written by: ${currentPost.author}`
$w("#postHeaderStrip").background.src = currentPost.coverImage
$w("#postHeaderStrip").show("fade")
}
As you are not having the Images By part you can simply delete the photographer name element on the post page itself and delete the line of code for it.
$w("#photographerName").text = `Images by: ${currentPost.photographer}`
Just note that the example is just using the field name of Author , which will have the field key of author. Whereas you are using a field name of Author name, which will give you a field key of authorName.
The quickest option for me would be for you to simply delete that one field of Author Name and simply add the same field back in and just call it Author.
This way it will match the field key of author in the code without you having to change it.
If you want to keep the field as Author Name (authorName), then you will need to change the code on your own site to reflect that difference.
$w("#authorName").text = `Written by: ${currentPost.authorName}`
Make sure that your extra data dataset has the same setup here.
Finally, it all works for me and if you have the used the exact same tutorial and not changed any of the elements id names or code, apart from taking out the images by element and line of code.
As well as making sure that you either changed the field to Author or changed the code to authorName, then there is no reason why this should not be working for you.