{"id":31426,"date":"2018-04-21T15:47:46","date_gmt":"2018-04-21T15:47:46","guid":{"rendered":"https:\/\/ampscript.guide\/image\/"},"modified":"2021-04-06T01:18:25","modified_gmt":"2021-04-06T01:18:25","slug":"image","status":"publish","type":"post","link":"https:\/\/ampscript.guide\/image\/","title":{"rendered":"Image"},"content":{"rendered":"<h2>Image<\/h2>\n<p>This function returns an HTML <code>img<\/code> tag with the specified Portfolio image.  It also sets the <code>title<\/code>, <code>alt<\/code>, <code>border<\/code> and <code>thid<\/code> attributes on the <code>img<\/code> tag.  The <code>title<\/code> and <code>alt<\/code> values are set to the name of the image as defined in the Portfolio.  The <code>border<\/code> is set to <code>0<\/code> in all circumstances.  The <code>thid<\/code> is a proprietary Marketing Cloud attribute that contains the ID of the specified image in the Portfolio.<\/p>\n<h3>Arguments<\/h3>\n<p><code>Image(1,2)<\/code><\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center\">Ordinal<\/th>\n<th style=\"text-align: left\">Type<\/th>\n<th style=\"text-align: left\">Required<\/th>\n<th style=\"text-align: left\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center\">1<\/td>\n<td style=\"text-align: left\">String<\/td>\n<td style=\"text-align: left\">True<\/td>\n<td style=\"text-align: left\">Customer\/External Key value of the image to return<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center\">2<\/td>\n<td style=\"text-align: left\">String<\/td>\n<td style=\"text-align: left\">True<\/td>\n<td style=\"text-align: left\">Customer\/External Key value of the image to return if the image for the specified Customer\/External Key is not found<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>NOTE: The Portfolio ID  in the <code>thid<\/code> value is not visible in the Marketing Cloud interface.<\/p>\n<p>NOTE: Keys for the Portfolio item can be found by selecting the item in the listing page and then clicking the Properties option in the toolbar.<\/p>\n<\/blockquote>\n<h3>Example 1<\/h3>\n<pre><code>%%[\n\nvar @imageKey, @imageKeyFallBack, @imageTag\nset @imageKey = \"limedash-logo-green\"\nset @imageKeyFallBack = \"limedash-logo-gray\"\n\nset @imageTag = Image(@imageKey, @imageKeyFallBack)\n\n]%%\n&lt;a href=\"https:\/\/limedash.com\"&gt;%%=v(@imageTag)=%%&lt;\/a&gt;<\/code><\/pre>\n<h4>Output<\/h4>\n<pre><code>&lt;a href=\"https:\/\/limedash.com\"&gt;&lt;img title=\"limedash-logo-green\" alt=\"limedash-logo-green\" src=\"http:\/\/image.S7.exacttarget.com\/lib\/fe9213727567077b7d\/m\/1\/087ae025-7205-4121-8d5c-366f4a3dc117.png\" border=\"0\" thid=\"c87075e6-1959-4e6c-8a08-775a40ca056e\"&gt;&lt;\/a&gt;<\/code><\/pre>\n<h3>Example 2<\/h3>\n<p>This example illustrates the output when the specified Customer\/External Key does not exist and the fallback image is returned:<\/p>\n<pre><code>%%[\n\nvar @imageKey, @imageKeyFallBack, @imageTag\nset @imageKey = \"limedash-logo-pink\" \/* does not exist *\/\nset @imageKeyFallBack = \"limedash-logo-gray\"\n\nset @imageTag = Image(@imageKey, @imageKeyFallBack)\n\n]%%\n&lt;a href=\"https:\/\/limedash.com\"&gt;%%=v(@imageTag)=%%&lt;\/a&gt;<\/code><\/pre>\n<h4>Output<\/h4>\n<pre><code>&lt;a href=\"https:\/\/limedash.com\"&gt;&lt;img title=\"limedash-logo-gray\" alt=\"limedash-logo-gray\" src=\"http:\/\/image.S7.exacttarget.com\/lib\/fe9213727567077b7d\/m\/1\/8aabd3b9-cf2a-4d41-a56b-bec76e2efd54.png\" border=0 thid=\"fd7c5499-1409-44cb-90d7-0873e7b51b20\"&gt;&lt;\/a&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Image This function returns an HTML img tag with the specified Portfolio image. It also sets the title, alt, border and thid attributes on the img tag. The title and alt values are set to the name of the image as defined in the Portfolio. The border is set to 0 in all circumstances. The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v14.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The AMPscript Guide - Image<\/title>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ampscript.guide\/image\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The AMPscript Guide - Image\" \/>\n<meta property=\"og:description\" content=\"Image This function returns an HTML img tag with the specified Portfolio image. It also sets the title, alt, border and thid attributes on the img tag. The title and alt values are set to the name of the image as defined in the Portfolio. The border is set to 0 in all circumstances. The [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ampscript.guide\/image\/\" \/>\n<meta property=\"og:site_name\" content=\"The AMPscript Guide\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-21T15:47:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-06T01:18:25+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ampscript.guide\/#website\",\"url\":\"https:\/\/ampscript.guide\/\",\"name\":\"The AMPscript Guide\",\"description\":\"The Definitive Scripting Manual for Salesforce Marketing Cloud\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ampscript.guide\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/image\/#webpage\",\"url\":\"https:\/\/ampscript.guide\/image\/\",\"name\":\"The AMPscript Guide - Image\",\"isPartOf\":{\"@id\":\"https:\/\/ampscript.guide\/#website\"},\"datePublished\":\"2018-04-21T15:47:46+00:00\",\"dateModified\":\"2021-04-06T01:18:25+00:00\",\"author\":{\"@id\":\"https:\/\/ampscript.guide\/#\/schema\/person\/5335042f77731e84f9808aecef25daec\"},\"breadcrumb\":{\"@id\":\"https:\/\/ampscript.guide\/image\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ampscript.guide\/image\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ampscript.guide\/image\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/\",\"url\":\"https:\/\/ampscript.guide\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/image\/\",\"url\":\"https:\/\/ampscript.guide\/image\/\",\"name\":\"Image\"}}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/ampscript.guide\/#\/schema\/person\/5335042f77731e84f9808aecef25daec\",\"name\":\"dev\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts\/31426"}],"collection":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/comments?post=31426"}],"version-history":[{"count":0,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts\/31426\/revisions"}],"wp:attachment":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/media?parent=31426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/categories?post=31426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/tags?post=31426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}