# Resources Control Setup

**URL:** <https://forums.realmacsoftware.com/t/resources-control-setup/44314>\
**Category:** RapidWeaver Elements\
**Created:** [August 16, 2024, 11:40pm UTC](https://forums.realmacsoftware.com/t/resources-control-setup/44314 "2024-08-16T23:40:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bill/32/107_2.png) [@Bill](https://forums.realmacsoftware.com/u/Bill)\
**Post date:** [August 16, 2024, 11:40pm UTC](https://forums.realmacsoftware.com/t/resources-control-setup/44314/1 "2024-08-16T23:40:57Z")

</div>

No property code for resources yet in docs, but guessing it’s this?:

```auto
{
  "title": "Resource:",
  "property": "resource",
  "resource": {}
}

```

Not sure if resource is for non-image files like pdf, zip, video, audio, etc?

Bill  
Stack-Its

---

<div class="post-metadata">

**Author:** ![tpbradley](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/tpbradley/32/25503_2.png) [@tpbradley](https://forums.realmacsoftware.com/u/tpbradley)\
**Post date:** [August 17, 2024, 11:36am UTC](https://forums.realmacsoftware.com/t/resources-control-setup/44314/2 "2024-08-17T11:36:43Z")

</div>

Yep, that’s it. I’ve updated the docs here

> **[Resource | Elements Manual](https://docs.realmacsoftware.com/elements-docs/elements-language/properties.json/ui-controls/resource)**

---

<div class="post-metadata">

**Author:** ![Bill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bill/32/107_2.png) [@Bill](https://forums.realmacsoftware.com/u/Bill)\
**Post date:** [August 17, 2024, 6:38pm UTC](https://forums.realmacsoftware.com/t/resources-control-setup/44314/3 "2024-08-17T18:38:16Z")

</div>

This is my resource control snippet text only:

```auto
{
  "title": "Resource:",
  "properties": [{
    "title": "Resource Title",
    "property": "resource",
    "resource": {}
   }]
}

```

The control is not showing in the sidebar and no value in template.

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [August 17, 2024, 6:44pm UTC](https://forums.realmacsoftware.com/t/resources-control-setup/44314/4 "2024-08-17T18:44:48Z")

</div>

I’m guessing there’s some ill formatted code around it? Can you show us the entire properties file? If so we can see if we can spot the error for you…

The following [code example](https://docs.realmacsoftware.com/elements-docs/elements-language/properties.json/ui-controls/resource) for the Resource control works:

```auto
{
    "groups": [{
        "title": "Resource Example",
        "properties": [{
            "title": "Resource",
            "property": "resource",
            "resource": {}
        }]
    }]
}

```

---

<div class="post-metadata">

**Author:** ![Bill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bill/32/107_2.png) [@Bill](https://forums.realmacsoftware.com/u/Bill)\
**Post date:** [August 17, 2024, 7:03pm UTC](https://forums.realmacsoftware.com/t/resources-control-setup/44314/5 "2024-08-17T19:03:39Z")

</div>

Here’s the entire properties file, so far 😉 :

```auto
{
"groups": [
  {
    "title" : "Group Name1",
    "icon": "textformat.size",
    "properties": [
      {
        "title": "Heading",
        "heading": {}
      },
      {
        "title": "Information",
        "information": {}
      },
      {
        "divider": {}
      },
      {
        "title": "Text1:",
        "properties": [{
          "title": "Text2",  
          "property": "text",
          "text": {
           "default": "Hi",
           "subtitle": "Subtitle"
          }
        }]
      },
      {
        "title": "TextArea:",
        "properties": [{
          "title": "TextArea2",
          "property": "textarea",
          "textArea": {
            "default": "Hello World",
            "subtitle": "Subtitle"
          }
        }]
      },
      {
        "title": "Image:",
        "property": "image",
        "image": {}
      },
      {
        "title": "Link:",
        "properties": [{
          "title": "Link Text",
          "property": "link",
          "link": {
            "subtitle": "Subtitle"
          }
        }]
      },
      {
        "title": "Number:",
        "properties": [{
          "title": "Number Title",
          "property": "number",
          "number": {
            "default": 100,
            "subtitle": "Subtitle"
          }
        }]
      },
      {
        "title": "Resource:",
        "properties": [{
          "title": "Resource Title",
          "property": "resource",
          "resource": {}
        }]
      },
      {
        "title": "Segmented:",
        "property": "alignment",
        "segmented": {
          "default": {
            "base": "align-left",
            "md": "align-center"
          },
          "items": [
            {
              "value": "align-left",
              "icon": "text.alignleft"
            },
            {
              "value": "align-center",
              "icon": "text.aligncenter",
              "default": true
            },
            {
              "value": "align-right",
              "icon": "text.alignright"
            }
          ]
        }
      },
      {
        "title": "Dropdown:",
        "property": "dropdown",
        "select": {
          "default": "none",
          "items": [
            {
              "title": "None",
              "value": "none"
            },
            {
              "title": "One",
              "value": "one"
            },
            {
              "title": "Two",
              "value": "two"
            }
          ]
        }
      },
      {
	    "title": "Slider-Number:",
	    "property": "slpercent",
	    "format": "{{value}}%",
	    "slider": {
		  "default": 50,
		  "min": 0,
		  "max": 100,
		  "units": "%",
		  "round": true
	    }
      },
      {
	    "title": "Slider-Text:",
	    "property": "sltext",
	    "slider": {
		  "default": "0",
		  "items": [
            {
              "title": "Zero",
              "value": "0"
            },
            {
              "title": "Fifty",
              "value": "50"
            },
            {
              "title": "One Hundred",
              "value": "100"
            }
          ]
	    }
      },
      {
        "title": "Switch-Boolean:",
        "property": "switch1",
        "responsive": false,
        "switch": {
          "default": false
        }
      },
      {
        "title": "Switch-String:",
        "property": "switch2",
        "switch": {
          "trueValue": "block",
          "falseValue": "hidden",
          "default": false
        }
      },
      {
        "title": "Border:",
        "property": "myborderwidth",
        "themeBorderWidth": {
          "default": {
            "base": {
              "top": "0",
              "right": "0",
              "bottom": "0",
              "left": "0"
            }
          }
        }
      },
      {
        "title": "Radius:",
        "property": "borderRadius",
        "themeBorderRadius": {
          "default": {
            "base": {
              "topRight": "none",
              "topLeft": "none",
              "bottomRight": "none",
              "bottomLeft": "none"
            }
          }
        }
      },
      {
        "title": "Color:",
        "property": "customColor",
        "format": "text-{{value}}",
        "themeColor": {
          "default": {
            "name": "black",
            "brightness": 300
          }
        }
      },
      {
        "title": "Font:",
        "property": "fontFamily",
        "themeFont": {
          "default": {
            "base": {"name": "body"},
            "md": {"name": "quote"},
            "sm": {"name": "heading"}
          }
        }
      },
      {
        "title": "Padding:",
        "property": "padding",
        "themeSpacing": {
          "mode": "padding",
          "default": {
            "base": {
              "left": "sm",
              "right": "sm",
              "top": "sm",
              "bottom": "sm"
            },
            "md": {
              "left": "md",
              "right": "md",
              "top": "md",
              "bottom": "md"
            }
          }
        }
      },
      {
        "title": "Margin:",
        "property": "margin",
        "themeSpacing": {
          "mode": "margin",
          "default": {
            "base": {
              "left": "sm",
              "right": "sm",
              "top": "sm",
              "bottom": "sm"
            },
            "md": {
              "left": "md",
              "right": "md",
              "top": "md",
              "bottom": "md"
            }
          }
        }
      },
      {
        "title": "Gap:",
        "property": "gap",
        "themeSpacing": {
          "mode": "gap",
          "default": {
            "base": {
              "left": "sm",
              "right": "sm",
              "top": "sm",
              "bottom": "sm"
            },
            "md": {
              "left": "md",
              "right": "md",
              "top": "md",
              "bottom": "md"
            }
          }
        }
      },
      {
        "title": "Transition:",
        "property": "transition",
        "themeSpacing": {
          "mode": "transition",
          "default": {
            "base": {
              "left": "sm",
              "right": "sm",
              "top": "sm",
              "bottom": "sm"
            },
            "md": {
              "left": "md",
              "right": "md",
              "top": "md",
              "bottom": "md"
            }
          }
        }
      },
      {
        "title": "Position:",
        "property": "position",
        "themeSpacing": {
          "mode": "position",
          "default": {
            "base": {
              "left": "sm",
              "right": "sm",
              "top": "sm",
              "bottom": "sm"
            },
            "md": {
              "left": "md",
              "right": "md",
              "top": "md",
              "bottom": "md"
            }
          }
        }
      },
      {
        "title": "BoxShadow:",
        "property": "boxshadow",
        "themeShadow": {
          "default": {
            "name": "none"
          }
        }
      },
      {
        "title": "Text Size:",
        "id": "textsize",
        "themeTextStyle": {
          "default": {
            "base": {
              "name": "base"
            }
          }
        }
      }
    ]
  },
  {
    "title" : "Group Name2",
    "icon": "textformat.size",
    "properties": [
      {
        "title": "Text2:",
        "property": "title",
        "text": {
          "default": "Hi2",
          "subtitle": "Subtitle"
        }
      }
    ]
  }
]
}

```

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [August 17, 2024, 7:11pm UTC](https://forums.realmacsoftware.com/t/resources-control-setup/44314/6 "2024-08-17T19:11:19Z")

</div>

Okay, that works here… where do you want the resources control?

Here it is working at the bottom of the file…

 ![CleanShot 2024-08-17 at 8 .12.56@2x](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/6/6/66968fc8a831ad141412df9ffd91e4ccd188e190.png)

or in Group Name2

 ![CleanShot 2024-08-17 at 8 .14.24@2x](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/1/3/13f0cbaba32cc3d1e7a6b186b782700244fdd6c8.png)

---

<div class="post-metadata">

**Author:** ![Bill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bill/32/107_2.png) [@Bill](https://forums.realmacsoftware.com/u/Bill)\
**Post date:** [August 17, 2024, 7:16pm UTC](https://forums.realmacsoftware.com/t/resources-control-setup/44314/7 "2024-08-17T19:16:18Z")

</div>

I guess you are asking where I put the resource call in Group Name1 - it’s already in there at about line #67

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [August 17, 2024, 7:26pm UTC](https://forums.realmacsoftware.com/t/resources-control-setup/44314/8 "2024-08-17T19:26:43Z")

</div>

Okay, so it’s a coding error. You had this…

 ![CleanShot 2024-08-17 at 8 .24.08@2x](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/1/5/150c557907b1d65eac47d49ea1e84224bf06164c.png)

and it should be this…

 ![CleanShot 2024-08-17 at 8 .24.52@2x](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/8/5/853bd45d3759c0126c5f0b363eb4db3ce8dc7355.png)

hope that helps, you fix up your other control issues too 😉

---

<div class="post-metadata">

**Author:** ![Bill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bill/32/107_2.png) [@Bill](https://forums.realmacsoftware.com/u/Bill)\
**Post date:** [August 17, 2024, 7:28pm UTC](https://forums.realmacsoftware.com/t/resources-control-setup/44314/9 "2024-08-17T19:28:04Z")

</div>

Ok, need to update all your docs again, as that properties attribute was added in last couple of days. Maybe it doesn’t work because my version doesn’t support that - and that’s what Tom is going to do?

---

<div class="post-metadata">

**Author:** ![tpbradley](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/tpbradley/32/25503_2.png) [@tpbradley](https://forums.realmacsoftware.com/u/tpbradley)\
**Post date:** [August 17, 2024, 7:45pm UTC](https://forums.realmacsoftware.com/t/resources-control-setup/44314/10 "2024-08-17T19:45:50Z")

</div>

Hi @Bill, the `properties` attribute has only ever been used in a top level group object. A group adds a collapsable group to the inspector and has just the `title` and `properties` attributes.

I updated all examples in the docs this morning to provide a complete properties json example which includes a top level group object. This is to make it easy to copy and paste a complete example into a custom component to see how it works.

Before I did this, there was an inconsistent mix of examples that either showed a complete example, or a partial example containing just a single UI control, or had syntax issues.

Please be careful when copying from the docs to an existing properties file, you’ll just need the object within the `properties` array, like this.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/7/6/76138d9a45a09e9d79c4f7a3f43357b89d18a72c.png)

---

<div class="post-metadata">

**Author:** ![Bill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bill/32/107_2.png) [@Bill](https://forums.realmacsoftware.com/u/Bill)\
**Post date:** [August 17, 2024, 7:54pm UTC](https://forums.realmacsoftware.com/t/resources-control-setup/44314/11 "2024-08-17T19:54:59Z")

</div>

I just posted to Dan about this: [Text Area Control Setup - #5 by Bill](https://forums.realmacsoftware.com/t/text-area-control-setup/44317/5)

The way you have it now is really going to confuse people and cause support loads 😉
