{"action":"created","issue":{"url":"https://api.github.com/repos/lavary/laravel-menu/issues/209","repository_url":"https://api.github.com/repos/lavary/laravel-menu","labels_url":"https://api.github.com/repos/lavary/laravel-menu/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/lavary/laravel-menu/issues/209/comments","events_url":"https://api.github.com/repos/lavary/laravel-menu/issues/209/events","html_url":"https://github.com/lavary/laravel-menu/issues/209","id":297324116,"number":209,"title":"[Question] How to make active in link","user":{"login":"yuliantosb","id":16331964,"avatar_url":"https://avatars2.githubusercontent.com/u/16331964?v=4","gravatar_id":"","url":"https://api.github.com/users/yuliantosb","html_url":"https://github.com/yuliantosb","followers_url":"https://api.github.com/users/yuliantosb/followers","following_url":"https://api.github.com/users/yuliantosb/following{/other_user}","gists_url":"https://api.github.com/users/yuliantosb/gists{/gist_id}","starred_url":"https://api.github.com/users/yuliantosb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuliantosb/subscriptions","organizations_url":"https://api.github.com/users/yuliantosb/orgs","repos_url":"https://api.github.com/users/yuliantosb/repos","events_url":"https://api.github.com/users/yuliantosb/events{/privacy}","received_events_url":"https://api.github.com/users/yuliantosb/received_events","type":"User","site_admin":false},"labels":[{"id":101198087,"url":"https://api.github.com/repos/lavary/laravel-menu/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-15T04:11:54Z","updated_at":"2018-02-19T03:53:29Z","closed_at":null,"author_association":"NONE","body":"Hello, sir I have a question, how to make active instead of anchor attribute, the default give a active css class on ul tag, but I want to a tag\r\n\r\n```\r\n<li>\r\n       <a class=\"active\" href=\"http://localhost/laravel/public/home\">Home</a>\r\n</li>\r\n<li>\r\n       <a href=\"http://localhost/laravel/public/user\">User Account</a>\r\n</li>\r\n```\r\n\r\nHow to make like that?\r\nMy code like this\r\n\r\n```\r\n$menu->add('Home', ['url' => 'home'])\r\n                ->link\r\n                ->active('home/*');\r\n\r\n$menu->add('User Account', ['url' => 'user'])\r\n                ->link\r\n                ->active('user/*');\r\n```\r\n\r\nbut, not working, the html rendered all link set active, I'm sorry my English bad. Thanks"},"comment":{"url":"https://api.github.com/repos/lavary/laravel-menu/issues/comments/366583117","html_url":"https://github.com/lavary/laravel-menu/issues/209#issuecomment-366583117","issue_url":"https://api.github.com/repos/lavary/laravel-menu/issues/209","id":366583117,"user":{"login":"dustingraham","id":1414400,"avatar_url":"https://avatars3.githubusercontent.com/u/1414400?v=4","gravatar_id":"","url":"https://api.github.com/users/dustingraham","html_url":"https://github.com/dustingraham","followers_url":"https://api.github.com/users/dustingraham/followers","following_url":"https://api.github.com/users/dustingraham/following{/other_user}","gists_url":"https://api.github.com/users/dustingraham/gists{/gist_id}","starred_url":"https://api.github.com/users/dustingraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dustingraham/subscriptions","organizations_url":"https://api.github.com/users/dustingraham/orgs","repos_url":"https://api.github.com/users/dustingraham/repos","events_url":"https://api.github.com/users/dustingraham/events{/privacy}","received_events_url":"https://api.github.com/users/dustingraham/received_events","type":"User","site_admin":false},"created_at":"2018-02-19T03:53:29Z","updated_at":"2018-02-19T03:53:29Z","author_association":"COLLABORATOR","body":"No. Only one or the other.\r\n\r\nThe way that CSS works, is that you may be able to only use it on the parent class, and change the CSS.\r\n\r\nExample if CSS is:\r\n\r\n```\r\nli.active { background-color: #f00; }\r\na.active { color:#0f0; }\r\n```\r\nYou could change it to...\r\n\r\n```\r\nli.active { background-color: #f00; }\r\nli.active > a { color:#0f0; }\r\n```\r\n\r\nThe `>` symbol means the immediate child. This way it won't also target children multiple levels deep. But it will also remove the requirement of the class to be on both.\r\n\r\nBut, this library is not designed to apply it to both. You could extend the `Item` class, and overwrite `activate` or call `activate` yourself targeting the item and the link to call active if you're crafty."}}
{"actor":{"display_login":"dustingraham"}}