I have avoided learning about databases for too long, and I would love some help in trying to figure this problem out.
I set up a Collection and would like to pull a value from the collection to use on a button within a repeater. Once a person clicks one of the buttons within this repeater, it should then scrollTo() down the page to the corresponding anchor link on that page.
I have several other repeater elements (textfields, images, etc) along with this button that I assigned values to through the Editor (not Corvid). Since I don’t know what I’m doing, I was hoping to just inject this one anchor button value through Corvid instead of trying to construct the whole repeater (and all the elements) through Corvid. If that’s not possible, let me know. Basically I’m just looking for the simplest way for my feeble mind to do this.
If I try to shortcut it, could I do something like:
import wixData from ‘wix-data’ ;
import wixLocation from “wix-location” ;
const collectionName = ‘Theme2-Nav’ ;
export function button12_click_1(event) {
var anchorName = getCurrentItem().anchor;
$w( ‘#anchorName’ ).scrollTo();
}
- anchor is the name of my database ID for those values in my collection Theme2-Nav.
Any help is much appreciated!
- Garrett