I am completely new to Wix and Velo. I do not know any coding at all, but I was told the only way to add what I want to my website was to use code (the Editor and third party apps do not work for what I want).
Using the Wix Editor, I created dynamic list pages that lists multiple activities from an Activities Collection and dynamic items pages that shows detailed information for each activity.
This is the screenshot of the Activities Collection:
![](https://static.wixstatic.com/media/00c621_f4ff2268bb8e418e98adefd6a57ab1d2~mv2.png/v1/fill/w_980,h_497,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/00c621_f4ff2268bb8e418e98adefd6a57ab1d2~mv2.png)
The Activity Title field is the primary field with the field key "title".
This is the dynamic category list page that lists the activities by Module (i.e. Module 1, Module 2 etc. values shown in the Module field) for each activity.
![](https://static.wixstatic.com/media/00c621_8039999bcff1469d9741a2f304178933~mv2.png/v1/fill/w_980,h_550,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/00c621_8039999bcff1469d9741a2f304178933~mv2.png)
This is the dynamic item page that shows the detailed content for each activity (like Activity Title, Activity Short Description etc).
![](https://static.wixstatic.com/media/00c621_ea10cb5d391c426385021b651d9040f9~mv2.png/v1/fill/w_980,h_551,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/00c621_ea10cb5d391c426385021b651d9040f9~mv2.png)
On each activity's page, under all the information, I want to add the option for users to add and view ratings and reviews for each activity on each activity dynamic item page, so that each page for each activity shows only the ratings and reviews submitted for that activity on that page and not show all the reviews submitted for all the activities on every activity page.
I found an old forum post https://www.wix.com/velo/forum/coding-with-velo/comments-reviews-on-dynamic-pages
If you scroll down on this page, there is a reply by Franz Coester on Sep 16, 2019 that includes some code on how to add ratings and reviews on dynamic pages.
Since I don't really know much about coding, I don't know how to edit this code to change the ids to refer to the items on my page, or the fields in my collections or anything...
I tried creating a Ratings collection like he says with a Reference back to my Activities collection (in his case his harbors collection/table), by adding a field in the collection, selecting the Field Type as Reference and selecting Activities collection under Referenced collection (please see screenshots below - the reference field is circled in red)
![](https://static.wixstatic.com/media/00c621_2c0c07575c0b4cc3be74a665bae09f2a~mv2.png/v1/fill/w_602,h_476,al_c,q_85,enc_auto/00c621_2c0c07575c0b4cc3be74a665bae09f2a~mv2.png)
![](https://static.wixstatic.com/media/00c621_6a849088269f41658ef2a68c5061f69a~mv2.png/v1/fill/w_980,h_498,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/00c621_6a849088269f41658ef2a68c5061f69a~mv2.png)
But I don't know if I am doing this correctly or not, because in the screenshots from Franz Coester in the old forum post, the reference field is showing a database icon, while my reference field is showing some kind of link icon:
Frank Coester's rating's collection with reference field
![](https://static.wixstatic.com/media/00c621_bde0a2e7ad1048bfaa67735b0f531831~mv2.png/v1/fill/w_980,h_238,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/00c621_bde0a2e7ad1048bfaa67735b0f531831~mv2.png)
My Ratings collection reference field:
![](https://static.wixstatic.com/media/00c621_af24d617204e46709fe9e74f7105799d~mv2.png/v1/fill/w_746,h_534,al_c,q_90,enc_auto/00c621_af24d617204e46709fe9e74f7105799d~mv2.png)
This is part of the code he used load the rating to display the average and total number of ratings on the dynamic item page for each harbor:
$w.onReady(function () {
$w('#harbouritem').onReady(() => {
harbouritem = $w('#harbouritem').getCurrentItem()
loadrating()
})
});
exportfunction loadrating() {
let ratings;
wixData.query('Ratings')
.eq('harbours',harbouritem._id)
.find()
.then(result => {
ratings = result.items
let sumrating = 0
let countrating = 0
let rating = 0
countrating = result.totalCount
result.items.forEach(res => {
sumrating += res.rating
})
if (sumrating,countrating) {rating = sumrating/countrating}
$w('#harbourrating').numRatings = countrating
if (rating > 0) {
$w('#harbourrating').rating = rating
}
else {
$w('#harbourrating').rating = undefined
}
})
}
I am having trouble understanding all the different things he is referring to in his code, like I don't know what '#harbouritem', 'Ratings','harbours', harbouritem._id, '#harbourrating' mean - are they the ids for elements on the page, the names of collections, fields from his collections or something else???
I also don't know how to refer to a field in my collections in the code - like what the syntax is...
The # symbol seems to only work to refer to the ids of elements on the actual page, not a field in a collection.
Because I am not understanding what he is referring to in his code, I also don't know what ids or code to substitute in his code so the code works with my collections, page elements etc.
So, I just need help from someone who can explain what each part of the code means and what I need to substitute to make it work for my website's pages.
I greatly appreciate any help.
Thank you so much,
RT
Dear @thomasrt73
Thank you for posting this.
For 2 weeks now I am also looking to add reviews/comments to my test dynamic page and dynamic list.
There is an old Wix product page example from 2018 that was adapted by WixIdeas
He adapts the product page reviews to dynamic page reviews. I followed this example and it has worked on my test page.
My hurdle is adding the average review and % recommended to each repeater container in the dynamic list.
There is hardly any examples of doing this. (Wix should really do this).
I found the link to these examples by Wix
https://www.wix.com/velo/examples?search=rating
Which I hope will help you. (not for me so far).
I have also asked for help here - no replies yet.
Wix have these as examples for review elements, but it seems how the average is calculated is different in the example done by WixIdeas.
I don't understand why Wix introduce a standard module for reviews and comments which can be added to the website like they have for Restaurant bookings etc.
It would really go a long way for people like us who use Wix for it ease of use features.
Adding comments/reviews has been a nightmare.