URL Link Substitution using Variables

  • Updated
  • Sometimes Zingtree variables will be URLs, and you'll want to make them into links in emails or a content node. For example, a variable can be a URL of an uploaded image file or document, or a generated PDF file from a Document Node.

    In tech-speak, you can set the ID or the class of an img or a href tag with the variable name, and it will replace the src= or href= part.

    Examples

    Assume we have a variable called my_url, which is the URL of a web page or document file.  The examples below are the HTML code to enter into your content node, via the </> tool.

    Make a button that links to a document using a class (can have many uses of this link in the entire tree):

    <a href="" class="btn btn-primary my_url">Get Document</a>

    |
    Make a button that links to a document using an ID (must have just one use of this link in the entire tree):

    <a href="" id="my_url" class="btn btn-primary">Get Document</a>


    Make a text link to a document:

    <a href="" class="my_url">Link to document</a>


    Replace an image:

    <img src="" class="my_url">


    Email nodes work differently. Here's how to generate a link in an email node:

    <a href="#my_url#">Open Document</a>

     

    Note that if you have multiple places where you want to substitute the URL, you should use class="my_url" instead of id="my_url".


  • Sometimes Zingtree variables will be URLs, and you'll want to make them into links in emails or a content node. For example, a variable can be a URL of an uploaded image file or document, or a generated PDF file from a Document Node.

    In tech-speak, you can set the ID or the class of an img or a href tag with the variable name, and it will replace the src= or href= part.

    Examples

    Assume we have a variable called my_url, which is the URL of a web page or document file.  The examples below are the HTML code to enter into your content node, via the </> tool.

    Make a button that links to a document using a class (can have many uses of this link in the entire tree):

    <a href="" class="btn btn-primary my_url">Get Document</a>

    |
    Make a button that links to a document using an ID (must have just one use of this link in the entire tree):

    <a href="" id="my_url" class="btn btn-primary">Get Document</a>


    Make a text link to a document:

    <a href="" class="my_url">Link to document</a>


    Replace an image:

    <img src="" class="my_url">


    Email nodes work differently. Here's how to generate a link in an email node:

    <a href="#my_url#">Open Document</a>

     

    Note that if you have multiple places where you want to substitute the URL, you should use class="my_url" instead of id="my_url".


  • Throughout 2022 Zingtree will be upgrading customers to our new faster and more modern user experience! Here's how to tell which experience your Zingtree Authors are currently using.

    Log in to your Zingtree Author account and navigate to My Trees. How does your current My Trees page look?

    Zingtree Classic

    2022-02-25_12-24-51.png

    New User Experience

    mceclip0.png

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request