Link to specific repeater item?

Hi,

I was hoping to link from one of my repeater items to another repeater item. For instance, let’s say I have twenty different items in my collection, one being “Chocolate” and another being “Vanilla” (excuse my lack of creative talent here). I have a link in Chocolate’s description that I wish to send the user to the vanilla repeater item as if I was using the scrollTo() function or an anchor. Can I do this? Preferably without code because I need this to be in the text, not as a button, like you see on most websites.

Thanks,
Ajani

If you are working with repeaters, than you have the possibility to use → INDEX of each item. Every item has his own index-number (beginning from 0).

You surely already have seen something like…

$w(‘#REPEATER’).onReady(()=>{$item, itemData, index });

You could use the index to navigate to the right item.

  1. Click onto a button in the repeater.

  2. If clicked button has the index=5 and is the chocolate-button, then set new index to 10, which will be the VANILA-index.

  3. Start a function which will search for the VANILA-INDEX, for example with a for-each-loop trough the repeater …
    https://www.wix.com/velo/reference/$w/repeater/foreachitem

  4. Another way perhaps could be to use the dataset.getItem() - function.

Just some theoretical thoughts. Try it out.

Hmm, okay, thanks. I’ll check it out and report back.

Hi @ajanistella, How was this solution? Thanks for reading, Brittany