I am currently adding an image to a blog post that is linked to a dataset of images so each post page will have a different image depending on the post. Can you tell me where would you put the code to check the url location based on which image is set on specific blog posts?
My problem is I have put the code in the post’s page’s onReady function (and dataset onReady page) but that is not getting called if I traverse from one page to another.
Any help will be appreciated. Thanks!!!
Can you explain more or attach screenshots?
yes sure!!
Expected Result : Add image on post page that is specific to each blog post.
My solution so far :
- Add a dataset object on post page and link it to a database of images.
- Add image to post page and link it to this dataset.
- Write the code to select relevant image for the post present in this dataset by checking the URL of the post using WIX-Location API.
Problem is where to place this code?
if I place it in onReady function (or Dataset ready function) of Post page then this solution works if I traverse via Menu bar but fails if I move from within post (via recent post link).
Steps to reciprocate :
- visit www.curiouspanda.in
- Go to Travel → Croatia → Weekend trip to Zadar post
- Scroll down to bottom of the page and click on budget trip to aspen post in Recent post section of this blog post.
- Notice the image on top of this page it is still the same as the one from previous post.
Please Note : you can see the correct behavior if you go separately to two posts via Travel → Croatia → Weekend trip to Zadar and Travel → USA → Budget Trip to …
Let me know if you need any further information.
I am quite flexible to adapt to any solution that leads to desired result of displaying a specific image on each blog post.
Thanks
Sorry I still didn’t understand. (You may attach the code you use)
The post page is a Danish page?
How do you create it as a page of the post?
And how do you connect the text and images to the database with code or clicks?