I have a page where I am not using a dynamic page, but I do have a Dataset connection on the page. I use a Velo to hide elements on dynamic (Title) pages. However, this code doesn’t seem to work in this case because I suspect the tag for ".getCurrentItem(); does not apply here.
$w . onReady (() => {
$w ( “#datasetAward” ). onReady (() => {
// Gets the current item properties and stores them in a variable called item
const item = $w ( “#datasetAward” ). getCurrentItem ();
// Checks if the current item has a value in the “video” field
if (! item . awardUrl ) {
// Collapses the video player if there is no value for “video”
$w ( “#button1” ). collapse ();
}
You are correct that getCurrentItem does not apply here. When working with datasets in repeaters, you actually need to iterate through the repeater UI element using the onItemReady() function for repeaters . So the code is going to look more like this:
This will iterate through every rendered “row” in your repeater to relates to a row in the dataset and look at the repeater UI elements in the context of the current Item (similarly to how getCurrentItem does it on dynamic pages). This lets you look at the data for a row, itemData, and make decisions for the UI elements related to that data, where $item is your new $w when iterating through the repeater.
I’m still very new to the editorx website creation platform although with the help of resources online I am finally getting an edge of it. However, I am currently facing an issue (one of a few)
I am designing a repeater for a real estate website (you know how items in a repeater is seamless across all containers in a repeater, right) and I discover that I don’t need certain items to show in a container inside the repeater ( one is a button, the other is a text, and then another is an image)
So here’s my question;
How do I remove/hide certain items in a container inside a repeater without affecting the display across other repeater boxes?