-
Notifications
You must be signed in to change notification settings - Fork 14
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
Alter HTML in Class methods #4
Comments
In what way do you want to change the markup? We could add a filter, but might prefer to improve the markup itself too. |
In this specific case this is our ideal markup (we are adding a header before the menu, note <h2 id="sidebar-menu-headline" class="sidebar-menu__headline"><span class="visually-hidden">Undernavigation för </span>{{ $ancestor }}</h2>
<nav id="sidebar-menu" aria-labelledby="sidebar-menu-headline">
<ul class="nav-aside hidden-xs hidden-sm">
{{ $menu }}
</ul>
</nav> The most logical place to change this would to me would be in |
A new example is in Municipio\Theme\Navigation::addSearchMagnifier() where we would like to remove pricon and alter classes. |
Please feel free to provide us with solution examples trough a PR. Ideally we should use blade engine in most cases. |
Cool. I actually looked through some of your source code to see if I could find any examples of Class methods using blade to render HTML, but didn't find anything. I'll see if I can look at this some more. |
You may do something like this function to fetch a template: https://github.com/helsingborg-stad/Municipio/blob/master/library/Template.php#L98 |
Municipio\Helper\Navigation::sidebarMenuAuto() contains HTML that we would like to alter:
It would be nice if that would be easier to do. Currently the only way to do it seems to be to replace sidebarMenuAuto() with our own function but it contains a lot of other logic which is a shame to duplicate.
The text was updated successfully, but these errors were encountered: