{"action":"opened","issue":{"url":"https://api.github.com/repos/assemble/assemble/issues/836","repository_url":"https://api.github.com/repos/assemble/assemble","labels_url":"https://api.github.com/repos/assemble/assemble/issues/836/labels{/name}","comments_url":"https://api.github.com/repos/assemble/assemble/issues/836/comments","events_url":"https://api.github.com/repos/assemble/assemble/issues/836/events","html_url":"https://github.com/assemble/assemble/issues/836","id":136106726,"number":836,"title":"Get the collection a view belongs to a middleware","user":{"login":"stefanwalther","id":669728,"avatar_url":"https://avatars.githubusercontent.com/u/669728?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanwalther","html_url":"https://github.com/stefanwalther","followers_url":"https://api.github.com/users/stefanwalther/followers","following_url":"https://api.github.com/users/stefanwalther/following{/other_user}","gists_url":"https://api.github.com/users/stefanwalther/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanwalther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanwalther/subscriptions","organizations_url":"https://api.github.com/users/stefanwalther/orgs","repos_url":"https://api.github.com/users/stefanwalther/repos","events_url":"https://api.github.com/users/stefanwalther/events{/privacy}","received_events_url":"https://api.github.com/users/stefanwalther/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-24T16:12:49Z","updated_at":"2016-02-24T16:12:49Z","closed_at":null,"body":"Hi,\r\n\r\nis it possible to get the collection a view is belonging to here:\r\n\r\n```js\r\napp.preLayout( /\\/content\\/.*\\.(md|hbs)/, function ( view, next ) {\r\n\r\n\t// Set the default layout for files with the extension .md or .hbs.\r\n\tif ( !view.layout ) {\r\n\t\tview.layout = 'default';\r\n\t}\r\n\r\n      // ==> I'd like to know the collection here to set some default values ...\r\n\r\n\tnext();\r\n} );\r\n````\r\n\r\n**Use case:**\r\n- Based on the collection I'd like to set some default values resp. double-checking the integrity of some Front-YML values.\r\n\r\nCannot find that while debugging ...\r\n\r\nRegards\r\nStefan\r\n\r\nP.S.: To satisfy the assemblebot: I am using assemble 0.9.1 ... ;-)"}}