Problem with custom attributes

Hello friends, I am making a real estate website. I am using a plugin called Real Estate Manger Pro. I didn’t like their property card designs so I decided to make my own with Cornerstone.

The thing is that these cards have some features like adding to favorites and making comparisons.

What I did was to make a looper provider for the post type “Properties” and then I made a grid and put a looper cosumer in the cell. Effectively I placed the images and the titles and descriptions using the hooks { }.

I used the default Cornerstone “buttons” elements to create the “favorites” and “compare” buttons. Now it’s time to make them work. So I contacted plugin support and they told me that I have to add the data-id attribute and the property id as value. Clearly I want this to work dynamically so I use this hook {{dc:post:meta key=“rem_property_id”}}. But for some reason when I click the button and visit the /favorites page it only works with the first element. All the others are not taken into account.

There are 4 cells of properties, but when I click on the add to favorites button it only works with the first one. Which in fact is the one with the looper consumer.

While I was writing this, I started to think that maybe it could be because the other 3 cells were so to speak remnants of the first one. So I created an individual cell for each one and put a looper consumer in each one. But it didn’t work anyway.

I appreciate any help you can give me.

Hi Ignacio,

Thanks for reaching out.
I have checked and found that you are using the Looper Provider wrongly and have added the Looper Consumer to all 4 slides. And also the meta key rem_property_id is not set for all the items. I have created a Test Page and set the Looper Consumer to All and used the Post ID into the data-id attribute, and the favorite is working now. I would suggest you check and replicate the same on the Home page.

Hope it helps.
Thanks

1 Like

@tristup
Man, thank you very much. U’re awesome. <3

You’re most welcome, Ignacio.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.