{"action":"created","issue":{"url":"https://api.github.com/repos/rainlab/pages-plugin/issues/239","repository_url":"https://api.github.com/repos/rainlab/pages-plugin","labels_url":"https://api.github.com/repos/rainlab/pages-plugin/issues/239/labels{/name}","comments_url":"https://api.github.com/repos/rainlab/pages-plugin/issues/239/comments","events_url":"https://api.github.com/repos/rainlab/pages-plugin/issues/239/events","html_url":"https://github.com/rainlab/pages-plugin/issues/239","id":213704451,"number":239,"title":"Head Placeholder","user":{"login":"mbaxter91288","id":3043062,"avatar_url":"https://avatars0.githubusercontent.com/u/3043062?v=4","gravatar_id":"","url":"https://api.github.com/users/mbaxter91288","html_url":"https://github.com/mbaxter91288","followers_url":"https://api.github.com/users/mbaxter91288/followers","following_url":"https://api.github.com/users/mbaxter91288/following{/other_user}","gists_url":"https://api.github.com/users/mbaxter91288/gists{/gist_id}","starred_url":"https://api.github.com/users/mbaxter91288/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbaxter91288/subscriptions","organizations_url":"https://api.github.com/users/mbaxter91288/orgs","repos_url":"https://api.github.com/users/mbaxter91288/repos","events_url":"https://api.github.com/users/mbaxter91288/events{/privacy}","received_events_url":"https://api.github.com/users/mbaxter91288/received_events","type":"User","site_admin":false},"labels":[{"id":409092184,"url":"https://api.github.com/repos/rainlab/pages-plugin/labels/Priority:%20High","name":"Priority: High","color":"EB6420","default":false},{"id":409092210,"url":"https://api.github.com/repos/rainlab/pages-plugin/labels/Type:%20Bug","name":"Type: Bug","color":"E11D21","default":false},{"id":409092207,"url":"https://api.github.com/repos/rainlab/pages-plugin/labels/Type:%20Question","name":"Type: Question","color":"CC317C","default":false}],"state":"open","locked":false,"assignee":{"login":"alekseybobkov","id":481606,"avatar_url":"https://avatars1.githubusercontent.com/u/481606?v=4","gravatar_id":"","url":"https://api.github.com/users/alekseybobkov","html_url":"https://github.com/alekseybobkov","followers_url":"https://api.github.com/users/alekseybobkov/followers","following_url":"https://api.github.com/users/alekseybobkov/following{/other_user}","gists_url":"https://api.github.com/users/alekseybobkov/gists{/gist_id}","starred_url":"https://api.github.com/users/alekseybobkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alekseybobkov/subscriptions","organizations_url":"https://api.github.com/users/alekseybobkov/orgs","repos_url":"https://api.github.com/users/alekseybobkov/repos","events_url":"https://api.github.com/users/alekseybobkov/events{/privacy}","received_events_url":"https://api.github.com/users/alekseybobkov/received_events","type":"User","site_admin":false},"assignees":[{"login":"alekseybobkov","id":481606,"avatar_url":"https://avatars1.githubusercontent.com/u/481606?v=4","gravatar_id":"","url":"https://api.github.com/users/alekseybobkov","html_url":"https://github.com/alekseybobkov","followers_url":"https://api.github.com/users/alekseybobkov/followers","following_url":"https://api.github.com/users/alekseybobkov/following{/other_user}","gists_url":"https://api.github.com/users/alekseybobkov/gists{/gist_id}","starred_url":"https://api.github.com/users/alekseybobkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alekseybobkov/subscriptions","organizations_url":"https://api.github.com/users/alekseybobkov/orgs","repos_url":"https://api.github.com/users/alekseybobkov/repos","events_url":"https://api.github.com/users/alekseybobkov/events{/privacy}","received_events_url":"https://api.github.com/users/alekseybobkov/received_events","type":"User","site_admin":false},{"login":"daftspunk","id":1392869,"avatar_url":"https://avatars1.githubusercontent.com/u/1392869?v=4","gravatar_id":"","url":"https://api.github.com/users/daftspunk","html_url":"https://github.com/daftspunk","followers_url":"https://api.github.com/users/daftspunk/followers","following_url":"https://api.github.com/users/daftspunk/following{/other_user}","gists_url":"https://api.github.com/users/daftspunk/gists{/gist_id}","starred_url":"https://api.github.com/users/daftspunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daftspunk/subscriptions","organizations_url":"https://api.github.com/users/daftspunk/orgs","repos_url":"https://api.github.com/users/daftspunk/repos","events_url":"https://api.github.com/users/daftspunk/events{/privacy}","received_events_url":"https://api.github.com/users/daftspunk/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2017-03-13T08:49:59Z","updated_at":"2017-10-29T01:30:54Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI am trying to include my Zendesk help widget into every backend page and I've achieved this with the below code:\r\n```\r\nEvent::listen('backend.page.beforeDisplay', function($controller, $action, $params) {\r\n    $controller->addJs('/plugins/thrivelounge/support/assets/js/zendesk.js');\r\n});\r\n```\r\nI would also like to configure this and as per the [Zendesk documentation](https://developer.zendesk.com/embeddables/docs/widget/zesettings#suppress) I need to include a script like below:\r\n```\r\n<script type=\"text/javascript\">\r\nwindow.zESettings = {\r\n  webWidget: {\r\n    chat: {\r\n      suppress: true\r\n    },\r\n    helpCenter: {\r\n      suppress: true\r\n    }\r\n  }\r\n};\r\n</script>\r\n```\r\nI've done this by updating the previous code snippet to:\r\n```\r\nEvent::listen('backend.page.beforeDisplay', function($controller, $action, $params) {\r\n    Block::append('head', $controller->makePartial('$/thrivelounge/support/partials/zendesk-settings.htm', ['settings' => Settings::instance()->getZendeskOptions()]));\r\n    $controller->addJs('/plugins/thrivelounge/support/assets/js/zendesk.js');\r\n});\r\n```\r\nI would like to be able to use an October settings page to enable and disable features, which is why I am rendering a partial and passing the settings. This is also why I can't use the normal `$controller->addJs...` like I have with the other file. This seems to work for all backend pages, expect this plugin and the Media Library. With some help from @LukeTowers I stumbled across this within the `plugins/rainlab/pages/controllers/index/index.htm` file:\r\n```\r\n<?= Block::put('head') ?><?= Block::endPut() ?>\r\n```\r\nThis is also within the Media Library controller page too. Removing this line resolves my issue.\r\n\r\nWhy is this here, I guess it has a reason? Can it be removed or is there another way to inject a dynamic `<script>` tag to the head of each backend page?\r\n\r\nAny help @daftspunk would be greatly appreciated.\r\n\r\nRegards,\r\nMat"},"comment":{"url":"https://api.github.com/repos/rainlab/pages-plugin/issues/comments/340231149","html_url":"https://github.com/rainlab/pages-plugin/issues/239#issuecomment-340231149","issue_url":"https://api.github.com/repos/rainlab/pages-plugin/issues/239","id":340231149,"user":{"login":"LukeTowers","id":7253840,"avatar_url":"https://avatars0.githubusercontent.com/u/7253840?v=4","gravatar_id":"","url":"https://api.github.com/users/LukeTowers","html_url":"https://github.com/LukeTowers","followers_url":"https://api.github.com/users/LukeTowers/followers","following_url":"https://api.github.com/users/LukeTowers/following{/other_user}","gists_url":"https://api.github.com/users/LukeTowers/gists{/gist_id}","starred_url":"https://api.github.com/users/LukeTowers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukeTowers/subscriptions","organizations_url":"https://api.github.com/users/LukeTowers/orgs","repos_url":"https://api.github.com/users/LukeTowers/repos","events_url":"https://api.github.com/users/LukeTowers/events{/privacy}","received_events_url":"https://api.github.com/users/LukeTowers/received_events","type":"User","site_admin":false},"created_at":"2017-10-29T01:30:54Z","updated_at":"2017-10-29T01:30:54Z","author_association":"MEMBER","body":"@daftspunk the only think that I can think of that will happen if we remove it is resources inserted into `head` from plugins in the backend would now be inserted on the mediamanager and StaticPages pages, but that would be the plugin's fault if it conflicted and I'm not sure what exactly what would cause it to conflict"}}
{"actor":{"display_login":"LukeTowers"}}