{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/8085","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/8085/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/8085/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/8085/events","html_url":"https://github.com/joomla/joomla-cms/pull/8085","id":111200559,"number":8085,"title":"Update contact form layout in favour of extending the form via plugins","user":{"login":"matrikular","id":1304616,"avatar_url":"https://avatars.githubusercontent.com/u/1304616?v=3","gravatar_id":"","url":"https://api.github.com/users/matrikular","html_url":"https://github.com/matrikular","followers_url":"https://api.github.com/users/matrikular/followers","following_url":"https://api.github.com/users/matrikular/following{/other_user}","gists_url":"https://api.github.com/users/matrikular/gists{/gist_id}","starred_url":"https://api.github.com/users/matrikular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrikular/subscriptions","organizations_url":"https://api.github.com/users/matrikular/orgs","repos_url":"https://api.github.com/users/matrikular/repos","events_url":"https://api.github.com/users/matrikular/events{/privacy}","received_events_url":"https://api.github.com/users/matrikular/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-13T15:07:22Z","updated_at":"2015-10-24T02:35:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/8085","html_url":"https://github.com/joomla/joomla-cms/pull/8085","diff_url":"https://github.com/joomla/joomla-cms/pull/8085.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/8085.patch"},"body":"Im currently working on a plugin to extend the contact form and noticed that with the current implementation of the form layout, the standard fields e.g. name, email, subject, message, [...] are rendered statically, followed by an iteration over custom **fieldsets** (see [default_form.php](https://github.com/joomla/joomla-cms/blob/staging/components/com_contact/views/contact/tmpl/default_form.php)).\r\n\r\nThis way you cannot insert custom fields (via plugins) between the default fields without creating a template override for default_form.php.\r\n\r\nWith this pull request, a system and / or content plugin can override and / or extend the fields and their **ordering** while maintaining the normal behavior for custom fieldsets without the need to create a template override.\r\n\r\n### Test instructions:\r\n* Install the rudimentary test / demo [plugin](http://dz.qshb.de/plg_system_contact.zip) and activate it\r\n* Create a contact item\r\n* Create a link to that contact item in a menu of your choice (doesn't need to be assigned to an existing user)\r\n* Navigate to that link and make sure to open the form tab / slide if it is not visible / selected by default\r\n\r\nThis would be the time where one has to create a template override to use custom fields in the default contact form. You could do either that or apply the patch to make the custom field show up in the form. **Note:** For this test, I included a field called: \"Bazquirk\" in the plugin.\r\n\r\nI mentioned earlier that the default static output would result in custom fields being appended to the form, regardless in which fieldset you put the custom field. This is and still will be the normal behavior, even with this patch (bc).\r\n\r\nTo include a custom field at the position of your choice you can now \"override\" the order with a plugin. In our example, it can be done by uncommenting line ~51 of the contact.php file (test / demo plugin).\r\n\r\nBefore the patch, the custom field would be appended (if not manually added in the template override).\r\n\r\nAfter the patch and in combination with \"reset\" from line ~51, the output of the fields will be in the order of how the fields are arranged in the form manifest that extends the form.\r\n\r\n**Note:** Make sure to delete the template override if you created one. Another way to test it would be to use the changed file of this pull request as the template override."},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/150743106","html_url":"https://github.com/joomla/joomla-cms/pull/8085#issuecomment-150743106","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/8085","id":150743106,"user":{"login":"bembelimen","id":1229869,"avatar_url":"https://avatars.githubusercontent.com/u/1229869?v=3","gravatar_id":"","url":"https://api.github.com/users/bembelimen","html_url":"https://github.com/bembelimen","followers_url":"https://api.github.com/users/bembelimen/followers","following_url":"https://api.github.com/users/bembelimen/following{/other_user}","gists_url":"https://api.github.com/users/bembelimen/gists{/gist_id}","starred_url":"https://api.github.com/users/bembelimen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bembelimen/subscriptions","organizations_url":"https://api.github.com/users/bembelimen/orgs","repos_url":"https://api.github.com/users/bembelimen/repos","events_url":"https://api.github.com/users/bembelimen/events{/privacy}","received_events_url":"https://api.github.com/users/bembelimen/received_events","type":"User","site_admin":false},"created_at":"2015-10-24T02:35:38Z","updated_at":"2015-10-24T02:35:38Z","body":"@test works as described\r\nBut I would also like to see ->renderField"}}