{"action":"created","issue":{"url":"https://api.github.com/repos/TryGhost/Ghost/issues/4541","labels_url":"https://api.github.com/repos/TryGhost/Ghost/issues/4541/labels{/name}","comments_url":"https://api.github.com/repos/TryGhost/Ghost/issues/4541/comments","events_url":"https://api.github.com/repos/TryGhost/Ghost/issues/4541/events","html_url":"https://github.com/TryGhost/Ghost/issues/4541","id":50396107,"number":4541,"title":"New Navigation Helper","user":{"login":"ErisDS","id":101513,"avatar_url":"https://avatars.githubusercontent.com/u/101513?v=3","gravatar_id":"","url":"https://api.github.com/users/ErisDS","html_url":"https://github.com/ErisDS","followers_url":"https://api.github.com/users/ErisDS/followers","following_url":"https://api.github.com/users/ErisDS/following{/other_user}","gists_url":"https://api.github.com/users/ErisDS/gists{/gist_id}","starred_url":"https://api.github.com/users/ErisDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErisDS/subscriptions","organizations_url":"https://api.github.com/users/ErisDS/orgs","repos_url":"https://api.github.com/users/ErisDS/repos","events_url":"https://api.github.com/users/ErisDS/events{/privacy}","received_events_url":"https://api.github.com/users/ErisDS/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TryGhost/Ghost/labels/themes","name":"themes","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/TryGhost/Ghost/milestones/21","labels_url":"https://api.github.com/repos/TryGhost/Ghost/milestones/21/labels","id":714211,"number":21,"title":"Next Backlog","description":"The issues here are ready to be worked on, but not high priority. Feel free to grab anything and work on it.","creator":{"login":"ErisDS","id":101513,"avatar_url":"https://avatars.githubusercontent.com/u/101513?v=3","gravatar_id":"","url":"https://api.github.com/users/ErisDS","html_url":"https://github.com/ErisDS","followers_url":"https://api.github.com/users/ErisDS/followers","following_url":"https://api.github.com/users/ErisDS/following{/other_user}","gists_url":"https://api.github.com/users/ErisDS/gists{/gist_id}","starred_url":"https://api.github.com/users/ErisDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErisDS/subscriptions","organizations_url":"https://api.github.com/users/ErisDS/orgs","repos_url":"https://api.github.com/users/ErisDS/repos","events_url":"https://api.github.com/users/ErisDS/events{/privacy}","received_events_url":"https://api.github.com/users/ErisDS/received_events","type":"User","site_admin":false},"open_issues":67,"closed_issues":209,"state":"open","created_at":"2014-07-08T17:00:33Z","updated_at":"2015-01-20T19:31:04Z","due_on":"2015-07-30T23:00:00Z","closed_at":null},"comments":1,"created_at":"2014-11-28T18:24:51Z","updated_at":"2015-01-21T00:10:51Z","closed_at":null,"body":"This is part of the Navigation epic: #4535\r\n\r\n--- \r\n\r\n![image](https://cloud.githubusercontent.com/assets/120485/5228785/917b5448-7717-11e4-9b1d-1e24a48e5729.png)\r\n\r\nOnce we've got data stored in the database for navigation items (see #4539), we need to add a new `{{navigation}}`. \r\n\r\nFor the content in the above screenshot this helper would output, exactly:\r\n\r\n```HTML\r\n<ul class=\"nav\">\r\n    <li class=\"nav-home\"><a href=\"http://my-ghost-blog.com\">Home</a></li>\r\n    <li class=\"nav-about\"><a href=\"http://my-ghost-blog.com/about\">About</a></li>\r\n    <li class=\"nav-news\"><a href=\"http://my-ghost-blog.com/tag/news\">News</a></li>\r\n</ul>\r\n```\r\n\r\n### Current State\r\n\r\nIf the current request URL matches the URL in a nav item then nav output adds \"current\" class, like\r\n\r\n```HTML\r\n<li class=\"nav-home nav-current\"><a href=\"http://my-ghost-blog.com\">Home</a></li>\r\n```\r\n\r\nThis means that inside the helper, we need to loop through the items from the database, and check if any of them match the current request URL. If it does, we should add a new `current` property to that item in the list, and pass this to the template.\r\n\r\n### Handlebars Template\r\n\r\nThis should work like the `{{pagination}}` helper, so the format can be overridden with a `navigation.hbs` partial. The default to override being something like:\r\n\r\n```HANDLEBARS\r\n<ul class=\"nav\">\r\n    {{#foreach nav}}\r\n    <li class=\"nav-{{label}} {{#if current}}nav-current{{/if}}\"><a href=\"{{url}}\">{{label}}</a></li>\r\n    {{/foreach}}\r\n</ul>\r\n```\r\n\r\n### Filter\r\n\r\nThe navigation helper should pass the data through a filter after it has been processed for the current state, and before it gets passed to the template."},"comment":{"url":"https://api.github.com/repos/TryGhost/Ghost/issues/comments/70761116","html_url":"https://github.com/TryGhost/Ghost/issues/4541#issuecomment-70761116","issue_url":"https://api.github.com/repos/TryGhost/Ghost/issues/4541","id":70761116,"user":{"login":"nsfmc","id":216572,"avatar_url":"https://avatars.githubusercontent.com/u/216572?v=3","gravatar_id":"","url":"https://api.github.com/users/nsfmc","html_url":"https://github.com/nsfmc","followers_url":"https://api.github.com/users/nsfmc/followers","following_url":"https://api.github.com/users/nsfmc/following{/other_user}","gists_url":"https://api.github.com/users/nsfmc/gists{/gist_id}","starred_url":"https://api.github.com/users/nsfmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsfmc/subscriptions","organizations_url":"https://api.github.com/users/nsfmc/orgs","repos_url":"https://api.github.com/users/nsfmc/repos","events_url":"https://api.github.com/users/nsfmc/events{/privacy}","received_events_url":"https://api.github.com/users/nsfmc/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T00:10:51Z","updated_at":"2015-01-21T00:10:51Z","body":"hi, i've done a brief amount of work on this and think i might be able to have a working version of this helper in the next few days. i have a few questions to ask that i'l ask in irc via irc, but i think i have a good grasp on how to implement this. Writing some helper spec tests right now and will aim to have a branch commit to reference for feedback in the next day or so.\r\n"}}