{"_id":"5937b2388e8d9b002f1df281","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"},"user":"542c5cfcddd3190e00228849","parentDoc":null,"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":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0.0"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-04T19:27:52.155Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"never","params":[],"url":""},"isReference":false,"order":5,"body":"[block:html]\n{\n  \"html\": \"<div class=\\\"github-deeplinks\\\">\\n    <a href=\\\"https://github.com/TryGhost/Ghost/blob/master/core/server/helpers/author.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/author_spec.js\\\"><i class=\\\"fa fa-check-square-o fa-right\\\"></i>Tests</a>\\n</div>\"\n}\n[/block]\nUsage: `{{author}}` or `{{#author}}{{/author}}`\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Type\",\n    \"h-1\": \"Parameter\",\n    \"h-2\": \"Attributes\",\n    \"0-0\": \"[Output](/docs/helpers#section-output),  or [Block](/docs/helpers#section-block), [Ghost](/docs/helpers#section-ghost)\",\n    \"0-1\": \"n/a\",\n    \"0-2\": \"* `autolink` (boolean, output only)\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n### Description\n\nThe author helper can be used as either an output or block helper, and provides different ways to access and output the information about a post author.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Hint\",\n  \"body\": \"Switch between the Handlebars and HTML tabs to see the the output from the helper\"\n}\n[/block]\nIf used as an output helper (ex. `{{author}}`) then it will post the name of the author and a link to the authors page.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{{#post}}\\n    {{author}}       \\n{{/post}\",\n      \"language\": \"html\",\n      \"name\": \"Handlebars\"\n    },\n    {\n      \"code\": \"<a href=\\\"/author/jo-bloggs/\\\">Jo Bloggs</a>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\nIf used in the context of a post to display author information (ex. {{#author}}some information{{/author}}), you can display different information such as author name, bio, url, email, etc.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{{#post}}\\n    {{#author}}\\n        <h3>{{name}}</h3>\\n        <p>{{bio}}</p>\\n    {{/author}}\\n{{/post}\",\n      \"language\": \"html\",\n      \"name\": \"Handlebars\"\n    },\n    {\n      \"code\": \"<h3>Jo Bloggs</h3>\\n<p>Blogger Extraordinaire</p>\",\n      \"language\": \"text\",\n      \"name\": \"HTML\"\n    }\n  ]\n}\n[/block]\n### List of Attributes\n\n* **id** - the incremental ID of the author\n* **name** - the name of the author\n* **slug** - the author's URL slug  (used in urls and also useful for class names)\n* **bio** - the author's bio\n* **location** - the author's location\n* **website** - the author's website\n* **twitter** - the author's twitter username ([twitter_url helper](doc:twitter_url))\n* **facebook** - the author's facebook username ([facebook_url helper](doc:facebook_url))\n* **profile_image** - the author's profile picture ([img_url helper](img_url))\n* **cover_image** - the author's cover image\n* **url** - the web address for the author's page ([url helper](doc:url))\n\n### Example Code\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{{#post}}\\n    {{#author}}\\n        <h3>Written by <a href=\\\"{{url}}\\\">{{name}}</a></h3>\\n        <div>To contact {{name}}, tweet {{twitter}} or visit {{website}}.</div>\\n    {{/author}}\\n    <div id=\\\"post-content\\\">{{content}}</div>\\n{{/post}\\n\",\n      \"language\": \"handlebars\",\n      \"name\": \"Handlebars\"\n    },\n    {\n      \"code\": \"<h3>Written by <a href=\\\"/author/author-slug\\\">Author Name</a></h3>\\n<div>To contact Author Name, tweet :::at:::mytwitter or visit https://mysite.com.</div>\\n<div id=\\\"post-content\\\">\\nPost content...\\n</div>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{{#foreach post}}\\n  <div id=\\\"author-header\\\">\\n    Written by {{author}}. Here is a quick bio:   \\n\\n    <p id=\\\"author-bio\\\">\\n      {{author.bio}}\\n    </p>\\n  </div>\\n\\n  <div id=\\\"post-content\\\">\\n    {{content words=\\\"100\\\"}}\\n  </div>\\n{{/foreach}}\",\n      \"language\": \"handlebars\",\n      \"name\": \"Handlebars\"\n    },\n    {\n      \"code\": \"<div id=\\\"author-header\\\">\\n  Written by <a href=\\\"/author/author-slug/\\\">Author Name</a>. Here is a quick bio:   \\n  <p id=\\\"author-bio\\\">\\n    Something awesome written about this author.\\n  </p>\\n</div>\\n\\n<div id=\\\"post-content\\\">\\n  100 words of post content...\\n</div>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<div id=\\\"post-footer\\\">\\n  Written by {{author}}.\\n\\t\\n  {{#author}}\\n  \\n    {{#if bio}}\\n      {{!-- use 3 braces to render HTML in the bio field --}}\\n      <p id=\\\"author-bio\\\">{{{bio}}}</p>\\n    {{/if}}\\n\\n    <ul class=\\\"author-links\\\">\\n      {{#if website}}\\n      <li>\\n        <i class=\\\"author-link fa fa-link\\\"></i>\\n        <a href=\\\"{{website}}\\\">{{website}}</a>\\n      </li>\\n      {{/if}}\\n      {{#if twitter}}\\n      <li>\\n        <i class=\\\"author-link fa fa-twitter\\\"></i>\\n        <a href=\\\"{{twitter_url}}\\\">{{twitter}}</a>\\n      </li>\\n      {{/if}}\\n      {{#if facebook}}\\n      <li>\\n        <i class=\\\"author-link fa fa-facebook\\\"></i>\\n        <a href=\\\"{{facebook_url}}\\\">Facebook</a>\\n      </li>\\n      {{/if}}\\n    </ul>\\n  \\n  {{/author}}\\n</div>\",\n      \"language\": \"handlebars\"\n    },\n    {\n      \"code\": \"<div id=\\\"post-footer\\\">\\n  Written by <a href=\\\"/author/author-slug/\\\">Author Name</a>.\\n\\t\\n  <p id=\\\"author-bio\\\">Something <strong>awesome</strong> about this author.</p>\\n \\n  <ul class=\\\"author-links\\\">\\n     <li>\\n      <i class=\\\"author-link fa fa-link\\\"></i>\\n       <a href=\\\"https://my-website.com\\\">https://my-website.com</a>\\n    </li>\\n    <li>\\n      <i class=\\\"author-link fa fa-twitter\\\"></i>\\n      <a href=\\\"https://twitter.com/myusername\\\">@myusername</a>\\n    </li>\\n    <li>\\n      <i class=\\\"author-link fa fa-facebook\\\"></i>\\n      <a href=\\\"https://www.facebook.com/myusername\\\">Facebook</a>\\n    </li>\\n  </ul>\\n</div>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]","excerpt":"`{{author}}` Helper - Output details of a post's author","slug":"author","type":"basic","title":"author"}

author

`{{author}}` Helper - Output details of a post's author

[block:html] { "html": "<div class=\"github-deeplinks\">\n <a href=\"https://github.com/TryGhost/Ghost/blob/master/core/server/helpers/author.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/author_spec.js\"><i class=\"fa fa-check-square-o fa-right\"></i>Tests</a>\n</div>" } [/block] Usage: `{{author}}` or `{{#author}}{{/author}}` [block:parameters] { "data": { "h-0": "Type", "h-1": "Parameter", "h-2": "Attributes", "0-0": "[Output](/docs/helpers#section-output), or [Block](/docs/helpers#section-block), [Ghost](/docs/helpers#section-ghost)", "0-1": "n/a", "0-2": "* `autolink` (boolean, output only)" }, "cols": 3, "rows": 1 } [/block] ### Description The author helper can be used as either an output or block helper, and provides different ways to access and output the information about a post author. [block:callout] { "type": "info", "title": "Hint", "body": "Switch between the Handlebars and HTML tabs to see the the output from the helper" } [/block] If used as an output helper (ex. `{{author}}`) then it will post the name of the author and a link to the authors page. [block:code] { "codes": [ { "code": "{{#post}}\n {{author}} \n{{/post}", "language": "html", "name": "Handlebars" }, { "code": "<a href=\"/author/jo-bloggs/\">Jo Bloggs</a>", "language": "html" } ] } [/block] If used in the context of a post to display author information (ex. {{#author}}some information{{/author}}), you can display different information such as author name, bio, url, email, etc. [block:code] { "codes": [ { "code": "{{#post}}\n {{#author}}\n <h3>{{name}}</h3>\n <p>{{bio}}</p>\n {{/author}}\n{{/post}", "language": "html", "name": "Handlebars" }, { "code": "<h3>Jo Bloggs</h3>\n<p>Blogger Extraordinaire</p>", "language": "text", "name": "HTML" } ] } [/block] ### List of Attributes * **id** - the incremental ID of the author * **name** - the name of the author * **slug** - the author's URL slug (used in urls and also useful for class names) * **bio** - the author's bio * **location** - the author's location * **website** - the author's website * **twitter** - the author's twitter username ([twitter_url helper](doc:twitter_url)) * **facebook** - the author's facebook username ([facebook_url helper](doc:facebook_url)) * **profile_image** - the author's profile picture ([img_url helper](img_url)) * **cover_image** - the author's cover image * **url** - the web address for the author's page ([url helper](doc:url)) ### Example Code [block:code] { "codes": [ { "code": "{{#post}}\n {{#author}}\n <h3>Written by <a href=\"{{url}}\">{{name}}</a></h3>\n <div>To contact {{name}}, tweet {{twitter}} or visit {{website}}.</div>\n {{/author}}\n <div id=\"post-content\">{{content}}</div>\n{{/post}\n", "language": "handlebars", "name": "Handlebars" }, { "code": "<h3>Written by <a href=\"/author/author-slug\">Author Name</a></h3>\n<div>To contact Author Name, tweet @mytwitter or visit https://mysite.com.</div>\n<div id=\"post-content\">\nPost content...\n</div>", "language": "html" } ] } [/block] [block:code] { "codes": [ { "code": "{{#foreach post}}\n <div id=\"author-header\">\n Written by {{author}}. Here is a quick bio: \n\n <p id=\"author-bio\">\n {{author.bio}}\n </p>\n </div>\n\n <div id=\"post-content\">\n {{content words=\"100\"}}\n </div>\n{{/foreach}}", "language": "handlebars", "name": "Handlebars" }, { "code": "<div id=\"author-header\">\n Written by <a href=\"/author/author-slug/\">Author Name</a>. Here is a quick bio: \n <p id=\"author-bio\">\n Something awesome written about this author.\n </p>\n</div>\n\n<div id=\"post-content\">\n 100 words of post content...\n</div>", "language": "html" } ] } [/block] [block:code] { "codes": [ { "code": "<div id=\"post-footer\">\n Written by {{author}}.\n\t\n {{#author}}\n \n {{#if bio}}\n {{!-- use 3 braces to render HTML in the bio field --}}\n <p id=\"author-bio\">{{{bio}}}</p>\n {{/if}}\n\n <ul class=\"author-links\">\n {{#if website}}\n <li>\n <i class=\"author-link fa fa-link\"></i>\n <a href=\"{{website}}\">{{website}}</a>\n </li>\n {{/if}}\n {{#if twitter}}\n <li>\n <i class=\"author-link fa fa-twitter\"></i>\n <a href=\"{{twitter_url}}\">{{twitter}}</a>\n </li>\n {{/if}}\n {{#if facebook}}\n <li>\n <i class=\"author-link fa fa-facebook\"></i>\n <a href=\"{{facebook_url}}\">Facebook</a>\n </li>\n {{/if}}\n </ul>\n \n {{/author}}\n</div>", "language": "handlebars" }, { "code": "<div id=\"post-footer\">\n Written by <a href=\"/author/author-slug/\">Author Name</a>.\n\t\n <p id=\"author-bio\">Something <strong>awesome</strong> about this author.</p>\n \n <ul class=\"author-links\">\n <li>\n <i class=\"author-link fa fa-link\"></i>\n <a href=\"https://my-website.com\">https://my-website.com</a>\n </li>\n <li>\n <i class=\"author-link fa fa-twitter\"></i>\n <a href=\"https://twitter.com/myusername\">@myusername</a>\n </li>\n <li>\n <i class=\"author-link fa fa-facebook\"></i>\n <a href=\"https://www.facebook.com/myusername\">Facebook</a>\n </li>\n </ul>\n</div>", "language": "html" } ] } [/block]