How do I link to an external URL using a compound

2019-07-07 17:04发布

In the documentation it says one can use a compound card chin to link/punch out to an external URL. However when I try something like this:

chin {
  url {
    template ("#{value (model.webUrl)}")
  }
}

it doesn't work. How can I get a chin with a link to an external URL working?

1条回答
做个烂人
2楼-- · 2019-07-07 17:57

To use a Chin punch out, you need to add the following:

  1. content
  2. A slot with a value for the URL link

So the following would work:

  render {
    layout {
      section {
        content {
          compound-card {
            content {
              single-line {
                text {
                  value {
                    template ("Click below to Punch Out")
                  }
                }
              }
            }
            chin {
              slot1 {
                single-line {
                  text {
                    value {
                      template ("Link to Google")
                    }
                  }
                }
              }
              url {
                template ("http://www.google.com")
              }
            }
          }
        }
      }
    }
  }
查看更多
登录 后发表回答