-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Menu] Set it more customizable? #149
Comments
I don't have an answer, I can just tell you that I am using my own You know you can add blocks where it makes sense. I am a contributor of the Tabler repo, so if you send reasonable PRs (instead of discussions) codecalm will likely merge it. Yes, he is not very responsive, which is fine (even though it can be annoying) ... it is still a free open source project. Give it a try and see what happens. |
Sorry for the late reply, I have been running after time lately ⏲️ 🏃
Funny part is THEY convert issues into discussions.
So you have ovewrote the
Agree for the Even today MenuItem has a TablerBundle/src/Model/MenuItemModel.php Line 25 in 17b3640
|
No, only the model for more features.
How? General rule of thumb is: whenever you have to use Make a proposal, I am not against it, if there is a good and safe use-case.
Yes, very likely 🙃 |
Okay, so I might need an external eye to solve my case then: Since parent is typed for MenuItemModelInterface we are a bit stuck.. use KevinPapst\TablerBundle\Model\MenuItemModel as TablerMenuItemModel;
class MenuItemModel extends TablerMenuItemModel
{
private bool $disabled = false;
public function isDisabled(): bool
{
// ❌ Polymorphic call => PhpStan will not allow that
return $this->getParent()?->isDisabled() ?? $this->disabled;
}
public function setDisabled(bool $disabled): void
{
$this->disabled = $disabled;
}
} ATE, I think I need to rewrite the whole MenuItemModel, and
|
You are the boss, not your tooling 😁 public function isDisabled(): bool
{
/** @var MenuItemModel $parent */
$parent = $this->getParent();
return $parent?->isDisabled() ?? $this->disabled;
} or public function isDisabled(): bool
{
$parent = $this->getParent();
if ($parent instanceof MenuItemModel) {
return $parent->isDisabled();
}
return $this->disabled;
} |
I need to make a "special" menu for a client with specific needs.
To be more detail, I need:
Problems:
raw
HTML link content).To be able to create the screenshot menu, I've overwritten the entire TWIG menu template as there's no
navbar_menu
block to overwrite it from an extend:https://github.com/kevinpapst/TablerBundle/blob/main/templates/layout-vertical.html.twig#L47-L51
Do we allows custom menu (from the subscriber), or it is a dev problem and overwriting the template is a good way to go?
The text was updated successfully, but these errors were encountered: