Link Control Setup

I’m trying the link control with this code in properties:

{
  "title": "Link:",
  "properties": [{
    "property": "link",
    "title": "Link Text",
    "link": {
      "subtitle": "Subtitle"
    }
  }]
}

and I’m trying to get the href using this in template:
Link: {{link.href}}

I don’t see the control in the sidebar or anything in template.

Bill
Stack-Its

If you’re not seeing the control in the inspector (or the inspector stops responding to changes) it would suggest a problem processing the properties json. I’m not sure if your sample is the full content or a snippet, but it appears to be missing the top level groups object.

Changing it to the following should work.

{
    "groups": [{
        "title": "Link:",
        "properties": [{
            "property": "link",
            "title": "Link Text",
            "link": {
                "subtitle": "Subtitle"
            }
        }]
    }]
}

Yes, I’m just showing the snippet inside of the main properties, but for clarity, here is a total example of my link property code:

{
"groups": [
  {
    "title" : "Group Name1",
    "icon": "textformat.size",
    "properties": [
      {
        "title": "Link:",
        "properties": [{
          "title": "Link Text",
          "property": "link",
          "link": {
            "subtitle": "Subtitle"
          }
        }]
      }
    ]
  }
]
}

Still control doesn’t show or value in template.

I’ve had a quick look and that code doesn’t seem right, why do you have the extra properties and title in there :thinking:

I’ve made some changes and it’s now working correctly:

{
  "groups": [
    {
      "title": "Group Name1",
      "icon": "textformat.size",
      "properties": [
        {
          "title": "Link Text",
          "property": "link",
          "link": {
            "subtitle": "Subtitle"
          }
        }
      ]
    }
  ]
}