How do I link to an external URL using a compound card chin

让人想犯罪 __ 提交于 2019-12-23 23:19:56

问题


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:


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")
              }
            }
          }
        }
      }
    }
  }


来源:https://stackoverflow.com/questions/56860123/how-do-i-link-to-an-external-url-using-a-compound-card-chin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!