Closed felpinhou closed 2 months ago
@felpinhou Please, take the time to add more details, add screenshots, etc. Otherwise it'll hard to imagine what are your goals.
You can add your own customizations to the layout template provided by the package, but it'll be up to you to make it work nicely. In order to add or change the layout template, follow the instructions on Views Customizations
I want to use two navbars, one on the home page and one on the dashboard, but whenever I do this, the page is broken
this dashboard
this is home, but Whenever I enter a dashboard page, the navbar keeps flashing without css
https://github.com/jeroennoten/Laravel-AdminLTE/assets/88860868/9ae05159-d88a-44a9-a683-d04f9cb6d370
this is my code... im brasilian kkkk, I have to deliver this project today without these css breaks
@felpinhou You need to understand that this isn't a problem on this package, it's related to your integration. I can see something weird in your index.blade.php
file. You are defining a new body
tag without closing it:
@section('header')
{{-- The next body tag is really wrong here!!! REMOVE THIS!! --}}
<body class="hold-transition layout-top-nav sidebar-collapse sidebar-closed">
@component('parts.top-navbar-dashboard')
@endcomponent
@endsection
The body tag is already defined in the adminlte::page
blade layout, and it's dynamically managed by the AdminLTE
package. Defining it again, even more without closing it, will cause a lot of conflicts. I'm not sure what you've tried to do there but it's really weird.
the body is already closed, in the default-template
but these css breaks still persist, but when I remove the navbar from the pages this break still continues :((
Do not add an extra body tag, remove it completely from your code, an HTML page can only have one body
or head
tags and that is already defined in the adminlte::page
layout you're extending.
like this?
No, keep your original code that you showed first, but remove lines:
<body class="hold-transition layout-top-nav sidebar-collapse sidebar-closed">
and
</body>
like this? So, I put the class that made the sidebar collapsed in ''classes_body"
but it still gives those css loading errors
https://github.com/jeroennoten/Laravel-AdminLTE/assets/88860868/537c38cb-1a60-4cbf-be15-561cbd7dfe10
the page works normally when it doesn't have the top-navbar-dashboard, but when we enter the dashboard where the menu appears, it keeps giving these css errors
Yes, like that. You don't need to add sidebar_collapsed
class, Since I see you're using layout_topnav=true
, and that's mean without sidebar. Read Layout Configuration.
Also, please review Usage section, to check how the package should be used.
Before arriving at this result, I tried to use the adminlte:config navbar, but I can't use different navbars on different pages, there are pages where I can't use the navbar, there are pages where the navbar has to be different and it doesn't work with this navbar from adminlte:config
@felpinhou it's hard to guess what are you trying to achieve. In your Laravel
project, you may extend the layout provided by this package to create an admin panel, the pages that don't need to show an admin panel, like your home page or other landing pages may be created with your own template. Once you arrive at the administration panel, there is no way to use different navbars while you keep navigating on it.
However, what you mean with different navbars? they have different links, or they have a different look/style?
differente look/style, is that, the only way to use a navbar without causing these css loading bugs, is to use the adminlte:config navbar, understand? And I want to use more than one navbar within my project
Well, I'm sure you can have a landing page, designed with your own style and with your own navbar implementation. The admin panel might then by accessed after the login process. Please, review your code, use the browser's console tool to check for errors, etc.
I can't help you much more here, the admin panel layout we offer here is bound to the underlying AdminLTE package, and it do not support replacing the navbar with your custom navbar.
@felpinhou If you're using Firefox on your testing, please check if you have this bug called Flash of Unstyled Content
:
Some solutions are provided there...
Closed, no more feedback, not a package bug.
Describe the bug
I wanted to use the navbars from my own template, is this possible?
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem or to shown the issue.
Environment
Complete the next environment information.
Additional context
Add any other context about the problem here. If you already have ideas to solve the issue, add them here or create a Pull Request (PR).