{"action":"created","issue":{"url":"https://api.github.com/repos/processwire/processwire-issues/issues/166","repository_url":"https://api.github.com/repos/processwire/processwire-issues","labels_url":"https://api.github.com/repos/processwire/processwire-issues/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/processwire/processwire-issues/issues/166/comments","events_url":"https://api.github.com/repos/processwire/processwire-issues/issues/166/events","html_url":"https://github.com/processwire/processwire-issues/issues/166","id":202175507,"number":166,"title":"New Template File Strategy not supporting multiple inner element replacement","user":{"login":"trk","id":455983,"avatar_url":"https://avatars.githubusercontent.com/u/455983?v=3","gravatar_id":"","url":"https://api.github.com/users/trk","html_url":"https://github.com/trk","followers_url":"https://api.github.com/users/trk/followers","following_url":"https://api.github.com/users/trk/following{/other_user}","gists_url":"https://api.github.com/users/trk/gists{/gist_id}","starred_url":"https://api.github.com/users/trk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trk/subscriptions","organizations_url":"https://api.github.com/users/trk/orgs","repos_url":"https://api.github.com/users/trk/repos","events_url":"https://api.github.com/users/trk/events{/privacy}","received_events_url":"https://api.github.com/users/trk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-01-20T15:58:29Z","updated_at":"2017-01-20T17:18:11Z","closed_at":null,"body":"### Short description of the issue\r\n\r\nI am using **region('content+', 'content');** function currently and want to change this usage with **New Template File Strategy**, but there is problem with multiple inner elements.\r\n\r\n**_main.php**\r\n```php\r\n<div id='content'></div>\r\n```\r\n**home.php**\r\n```php\r\n<div id='content' class='pw-replace'>\r\n     <div>Content 1</div>\r\n     <div>Content 2</div>\r\n     <div>Content 3</div>\r\n</div>\r\n```\r\nAnother **home.php** example\r\n```php\r\n<div id='content' class='pw-replace'>\r\n     <div>\r\n          <div>Content 1</div>\r\n          <div>Content 2</div>\r\n     </div>\r\n</div>\r\n```\r\n\r\nAnother **home.php** example\r\n```php\r\n<div id='content' class='pw-replace'>\r\n     <div>\r\n            <div>\r\n                <div>\r\n                    <div>\r\n                        Content 1\r\n                        <div>\r\n                            Content 2\r\n                            <div>\r\n                                Content 2.1\r\n                                <div>\r\n                                    Content 2.1.1\r\n                                </div>\r\n                                <div>\r\n                                    Content 2.1.2\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n</div>\r\n```\r\nScreenshot for output (repeated items prints before html tag) :\r\n![ekran resmi 2017-01-20 19 16 17](https://cloud.githubusercontent.com/assets/455983/22156581/98191012-df3c-11e6-933f-6ee6beb9cc89.png)\r\n\r\n\r\nOutput starting before html, if i use 1 inner element output is ok."},"comment":{"url":"https://api.github.com/repos/processwire/processwire-issues/issues/comments/274127466","html_url":"https://github.com/processwire/processwire-issues/issues/166#issuecomment-274127466","issue_url":"https://api.github.com/repos/processwire/processwire-issues/issues/166","id":274127466,"user":{"login":"ryancramerdesign","id":328272,"avatar_url":"https://avatars.githubusercontent.com/u/328272?v=3","gravatar_id":"","url":"https://api.github.com/users/ryancramerdesign","html_url":"https://github.com/ryancramerdesign","followers_url":"https://api.github.com/users/ryancramerdesign/followers","following_url":"https://api.github.com/users/ryancramerdesign/following{/other_user}","gists_url":"https://api.github.com/users/ryancramerdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/ryancramerdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryancramerdesign/subscriptions","organizations_url":"https://api.github.com/users/ryancramerdesign/orgs","repos_url":"https://api.github.com/users/ryancramerdesign/repos","events_url":"https://api.github.com/users/ryancramerdesign/events{/privacy}","received_events_url":"https://api.github.com/users/ryancramerdesign/received_events","type":"User","site_admin":false},"created_at":"2017-01-20T17:18:11Z","updated_at":"2017-01-20T17:18:11Z","body":"This is no such thing as complex usages, because WireMarkupRegions only sees the final markup. So it really doesn't matter what methods you use to generate it in the first place, as it's not involved in that part of it. It just sees the HTML that comes before the `<!doctype` and considers that for placements in HTML that comes after the doctype. You would just have to make sure that your HTML is valid (like open tags match to closing tags in the right order). So long as it does, it should all work just fine. If you are coming across some situation where it's not working, I would just need to see the markup in question, not the code used to generate it. \r\n\r\nThat `<region:content` syntax you mentioned above is not a supported syntax. If you are wanting to use the \"region\" keyword like that, this would be the closest thing that would work: \r\n~~~~\r\n<region id=content pw-append>\r\n  <p>Append this paragraph to #content</p>\r\n</region>\r\n~~~~\r\nYou can replace pw-append with any of the other actions (prepend, before, after, etc.)"}}
{"actor":{"display_login":"ryancramerdesign"}}