top of page

Add a Title

Add a Title
Published Date
{postDate}
Tags
0 Comments
Views
Share Post

Comment

successMessage

errorMessage

Add a Title

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.

No comments yet. Be the first to comment!"
01 //
NEWS & UPDATES

Related Posts

Category

{publishedDate}

{postTitle}

{postParagraph}

Start Now
Category

{publishedDate}

{postTitle}

{postParagraph}

Start Now
Category

{publishedDate}

{postTitle}

{postParagraph}

Start Now
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