{"_id":"5937b2388e8d9b002f1df28e","category":{"_id":"5937b2388e8d9b002f1df272","version":"5937b2378e8d9b002f1df26e","project":"542fe92a5eceb608003fddc8","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-04T12:45:40.548Z","from_sync":false,"order":3,"slug":"helper-reference","title":"Helper Reference"},"parentDoc":null,"user":"542c5cfcddd3190e00228849","project":"542fe92a5eceb608003fddc8","version":{"_id":"5937b2378e8d9b002f1df26e","project":"542fe92a5eceb608003fddc8","__v":1,"createdAt":"2017-06-07T07:58:47.936Z","releaseDate":"2017-06-07T07:58:47.936Z","categories":["5937b2388e8d9b002f1df26f","5937b2388e8d9b002f1df270","5937b2388e8d9b002f1df271","5937b2388e8d9b002f1df272","5937b2388e8d9b002f1df273","5937b2388e8d9b002f1df274"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0.0"},"__v":0,"updates":["54681de7016b480800bc7cf3"],"next":{"pages":[],"description":""},"createdAt":"2014-10-21T16:36:59.894Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"never","params":[],"url":""},"isReference":false,"order":38,"body":"[block:html]\n{\n  \"html\": \"<div class=\\\"github-deeplinks\\\">\\n    <a href=\\\"https://github.com/TryGhost/Ghost/blob/master/core/server/helpers/img_url.js\\\"><i class=\\\"fa fa-github-alt fa-right\\\"></i>Source</a>\\n    <a href=\\\"https://github.com/TryGhost/Ghost/blob/master/core/test/unit/server_helpers/img_url_spec.js\\\" class=\\\"fa fa-check-square-o fa-right\\\">Tests</a>\\n</div>\"\n}\n[/block]\nUsage: `{{img_url}}`\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Type\",\n    \"h-1\": \"Parameters\",\n    \"h-2\": \"Attributes\",\n    \"0-0\": \"[Output](/docs/helpers#section-output), [Ghost](/docs/helpers#section-ghost)\",\n    \"0-1\": \"n/a\",\n    \"0-2\": \"* `absolute` (boolean)\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n### Description\n\nThe img url helper outputs either the image URL depending on the scope in which it is used.\n\nYou can force the image helper to output an absolute url by using the absolute option, E.g. `{{img_url profile_image absolute=\"true\"}}`\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{{#post}}\\n\\t{{img_url feature_image}} //Outputs post's image\\n\\t{{img_url author.profile_image absolute=\\\"true\\\"}} //Outputs post author's image to author context as absolute URL\\n{{/post}}\",\n      \"language\": \"html\",\n      \"name\": \"Post Context\"\n    },\n    {\n      \"code\": \"{{#author}}\\n\\t{{img_url profile_image}} //Outputs this author's image\\n{{/author}}\",\n      \"language\": \"html\",\n      \"name\": \"Author Context\"\n    }\n  ]\n}\n[/block]","excerpt":"`{{img_url}}` Helper - Output a post or author image","slug":"img_url","type":"basic","title":"img_url"}

img_url

`{{img_url}}` Helper - Output a post or author image

[block:html] { "html": "<div class=\"github-deeplinks\">\n <a href=\"https://github.com/TryGhost/Ghost/blob/master/core/server/helpers/img_url.js\"><i class=\"fa fa-github-alt fa-right\"></i>Source</a>\n <a href=\"https://github.com/TryGhost/Ghost/blob/master/core/test/unit/server_helpers/img_url_spec.js\" class=\"fa fa-check-square-o fa-right\">Tests</a>\n</div>" } [/block] Usage: `{{img_url}}` [block:parameters] { "data": { "h-0": "Type", "h-1": "Parameters", "h-2": "Attributes", "0-0": "[Output](/docs/helpers#section-output), [Ghost](/docs/helpers#section-ghost)", "0-1": "n/a", "0-2": "* `absolute` (boolean)" }, "cols": 3, "rows": 1 } [/block] ### Description The img url helper outputs either the image URL depending on the scope in which it is used. You can force the image helper to output an absolute url by using the absolute option, E.g. `{{img_url profile_image absolute="true"}}` [block:code] { "codes": [ { "code": "{{#post}}\n\t{{img_url feature_image}} //Outputs post's image\n\t{{img_url author.profile_image absolute=\"true\"}} //Outputs post author's image to author context as absolute URL\n{{/post}}", "language": "html", "name": "Post Context" }, { "code": "{{#author}}\n\t{{img_url profile_image}} //Outputs this author's image\n{{/author}}", "language": "html", "name": "Author Context" } ] } [/block]