{"action":"opened","issue":{"url":"https://api.github.com/repos/FluidTYPO3/vhs/issues/1085","repository_url":"https://api.github.com/repos/FluidTYPO3/vhs","labels_url":"https://api.github.com/repos/FluidTYPO3/vhs/issues/1085/labels{/name}","comments_url":"https://api.github.com/repos/FluidTYPO3/vhs/issues/1085/comments","events_url":"https://api.github.com/repos/FluidTYPO3/vhs/issues/1085/events","html_url":"https://github.com/FluidTYPO3/vhs/issues/1085","id":169381467,"number":1085,"title":"[BUG] v:menu ignores hideIfEmpty in manual rendering","user":{"login":"tantegerda1","id":4216652,"avatar_url":"https://avatars.githubusercontent.com/u/4216652?v=3","gravatar_id":"","url":"https://api.github.com/users/tantegerda1","html_url":"https://github.com/tantegerda1","followers_url":"https://api.github.com/users/tantegerda1/followers","following_url":"https://api.github.com/users/tantegerda1/following{/other_user}","gists_url":"https://api.github.com/users/tantegerda1/gists{/gist_id}","starred_url":"https://api.github.com/users/tantegerda1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tantegerda1/subscriptions","organizations_url":"https://api.github.com/users/tantegerda1/orgs","repos_url":"https://api.github.com/users/tantegerda1/repos","events_url":"https://api.github.com/users/tantegerda1/events{/privacy}","received_events_url":"https://api.github.com/users/tantegerda1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-04T14:00:24Z","updated_at":"2016-08-04T14:00:24Z","closed_at":null,"body":"It doesn't exactly _ignore_ it but it falls back to automatic rendering instead - yielding an auto-generated menu in cases where a handcrafted menu should remain empty.\r\n\r\n---\r\n# Example:\r\n\r\n```xml\r\n<v:menu pageUid=\"1\" as=\"menuItems\" hideIfEmpty=\"true\">\r\n    <f:for each=\"{menuItems}\" as=\"menuItem\">\r\n        <f:if condition=\"{menuItem.someAttribute} == foo\">\r\n            <a href=\"{menuItem.link}\">{menuItem.linktext}</a>\r\n        </f:if>\r\n    </f:for>\r\n</v:menu>\r\n```\r\n----\r\n## Case 1\r\n```\r\nPage 1\r\n+-+ Page 10\r\n| + Page 11\r\n| + Page 12 (someAttribute=foo)\r\n```\r\n```html\r\n<a href=\"?id=12\">Page 12</a>\r\n```\r\n## Case 2\r\n_(same structure, just attribute differs)_\r\n```\r\nPage 1\r\n+-+ Page 10\r\n| + Page 11\r\n| + Page 12\r\n```\r\n```html\r\n<ul>\r\n    <li>\r\n       <a href=\"?id=10\">Page 10</a>\r\n       <a href=\"?id=11\">Page 11</a>\r\n       <a href=\"?id=12\">Page 12</a>\r\n    </li>\r\n</ul>\r\n```\r\nWhile the expected result here would be:\r\n```html\r\n````\r\n---\r\n# Explanation:\r\nOnce the tag content (manual rendering mode) is rendered, the ViewHelper [recognizes that the output is empty after trimming](https://github.com/FluidTYPO3/vhs/blob/development/Classes/ViewHelpers/Menu/AbstractMenuViewHelper.php#L269) and (wrongly) assumes automatic rendering. Since the automatic rendering **does** deliver some output, it is no longer affected by `hideIfEmpty`.\r\n\r\n"}}
{"actor":{"display_login":"tantegerda1"}}