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 15, 2020
  • 1 min read

Updated: Dec 29, 2023

Have you ever created dynamic pages using a database and find out that some information on some pages just wasn't necessary? For example, when creating dynamic pages for team members, maybe some do not have LinkedIn pages to link to. Then it would be a little awkward to include an empty LinkedIn link on their profile page, right?

CMS Fields

$w("#myDataset").onReady( () => { 

       let item = $w("#myDataset").getCurrentItem(); 
       if (item.image) {
          $w("#imageElement").show();
       } else {
          $w("#imageElement").collapse();
          $w("#imageElement").hide();
       }
    } );

 

To make sure that the code is fully functional on your website, make sure the name for #myDatabase is the same as the database element on your page. And make sure the name for each #imageElement is the same for what element you want to hide or show on the page.

Comments


bottom of page