Trying to hide elements based on database

You can read the articles about Connecting Data to learn how to use datasets. The wix-dataset API docs contains all of the details and features of a dataset.

As a quick example, depending on what you are trying to do, your code might look something like this:

$w.onReady( () => {
   $w("#myDataset").onReady( () => {
   let itemObj = $w("#myDataset").getCurrentItem();
   if(itemObj.template === "1") {
      $w("#box1").show();
   } else {
       $w("#box2").hide();
   }
} );

Good luck and have fun,

Yisrael