90%
top of page

Add a Title

Add a Title
Published Date
Published Date
Tags
0 Comments
Views
Share Post

Comment

successMessage

errorMessage

Add a Title

Add paragraph text. Click “Edit Text” to update the font, size and more. To change and reuse text themes, go to Site Styles.

Add a Title

No comments yet. Be the first to comment!"

Related Posts

Start Now
Start Now

Add paragraph text. Click “Edit Text” to update the font, size and more. To change and reuse text themes, go to Site Styles.

Add a Title

Start Now
Start Now

Add paragraph text. Click “Edit Text” to update the font, size and more. To change and reuse text themes, go to Site Styles.

Add a Title

Start Now
Start Now

Add paragraph text. Click “Edit Text” to update the font, size and more. To change and reuse text themes, go to Site Styles.

Add a Title

  • Writer: @lan Design
    @lan Design
  • Dec 26, 2023
  • 1 min read

Updated: Nov 29, 2024

In this lesson, you will learn how to use CMS Database content to control what elements show in repeaters.


$w.onReady(function () {

    $w('#dataset1').onReady(() => {
        $w('#repeater1').onItemReady(($item, itemData) => {
            let sTitle = itemData.specialTitle;
            if (sTitle === "" || sTitle === null || sTitle === undefined) 
                $item("#badge").hide();
            } else {
                $item("#badge").show();
            }
        })
    })
});

For this Velo code to run properly on your website, you either need to name your dataset to "dataset1" or change the code to match the name you provided to it. Same goes for the Repeater, badge, and lastly, make sure you use the correct Field Key from your database.


Have Fun!


Comments


bottom of page