ColorlibHQ / AdminLTE

AdminLTE - Free admin dashboard template based on Bootstrap 5
https://adminlte.io
MIT License
44.11k stars 18.17k forks source link

Hyperlinks not working in control sidebar #1502

Closed larry-tx closed 7 years ago

larry-tx commented 7 years ago

I have standard HTML hyperlinks in my control sidebar, copied from other places where they work just fine. However, when I put them into the control sidebar, they don't work. When I look at the page source, one such link appears as: Test Link 2 which is appropriate. However, when I mouse over the displayed text, the mouse cursor does not change, and the link is unclickable. Any ideas?

kabutotx commented 7 years ago

sidebar-menu is a ul so you need a li with the ahref inside the li. ex.

<ul class="sidebar-menu">
<li><a href=""><i class="fa fa-link"></i> <span>Another Link</span></a></li>
</ul>
larry-tx commented 7 years ago

Actually, my link is in the control sidebar which in the documentation and examples from almaseed does not get the sidebar-menu class added to the ul which I had in my original. My apologies for not including it. My actual code snippet in my control sidebar, after your addition is:

<ul class="sidebar-menu">
        <li><a href="http://larrylutz.lcl/herbal-forms">Test Link 2</a></li>
    </ul>

That has the very same problem that I reported in my original issue. It does not work. I should have noted that I also have this in my control sidebar which does not work also:

<ul class="nav nav-tabs nav-justified control-sidebar-tabs">
    <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>

    <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
</ul>

Please note that this is actually a remnant of the code from the dist folder in the AdminLTE theme, not something that I made up. I do have to say that I find it unimaginable that a class on a ul element would prevent a link from working, and clearly at least, adding the class does not make the link work.

kabutotx commented 7 years ago

Then it would be class="control-sidebar-menu". Since you have tabs in your ul class make sure you have the tab-content and tab-pane divs before.

larry-tx commented 7 years ago

Interesting guessing game we've got going here. Sounds like no one knows for sure how this thing works. I totally deleted the section that has

<ul class="nav nav-tabs nav-justified control-sidebar-tabs">
    <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>

    <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
</ul>

I am now left with nothing in the control sidebar div except

<div>

    <p>Controller: <?= Yii::$app->controller->id; ?></p>

    <ul class="sidebar-menu">
        <li><a href="http://larrylutz.lcl/herbal-forms">Test Link 2</a></li>
    </ul>
</div>
<!-- /.control-sidebar -->
<!-- Add the sidebar's background. This div must be placed
     immediately after the control sidebar -->
<div class="control-sidebar-bg"></div>

It still does not work. Any more guesses?

kabutotx commented 7 years ago

control-sidebar is an aside. I would take a look at starter.html. The control-sidebar code is after the footer at the end of the file. Basically you have:

  1. control-sidebar aside
  2. tabs ul /ul
  3. tab-content div
  4. tab-pane div

I would assume you can have just the aside and no tabs but haven't played with that.

larry-tx commented 7 years ago

Yes, I am very much aware that the control-sidebar is an aside, one of the now aging HTML5 sections that extended, improved and enhanced the div HTML element. I am very familiar with all that. I simply took the control-sidebar aside that follows the footer.main-footer section (footer being one of the HTML5 sections like the aside) as found in starter.html and a myriad of other sample files (who continues to use the .html extension; I thought we'd all gone to .htm) and stripped its contents so that I was working with something that looked like:

<!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
  ...
  </aside>
  <!-- /.control-sidebar -->
  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>

I then began inserting my stuff between the

tags. It's just that simple and should be just that simple. I know you can disable or change the cursor on hover over a hyperlink with :hover, but who on earth would ever disable hyperlinks?

kabutotx commented 7 years ago

Hmmm... The only thing I can thing is to watch the developer tools console in your browser and see if something pops up. I just did the aside and only an ahref inside and it works fine.

larry-tx commented 7 years ago

At this point, this has taken way too much time. There are way too many “premium” quality themes that can be picked up for $15–20 dollars with good quality support and which will work. Time to cut the losses and go elsewhere.

From: kabutotx [mailto:notifications@github.com] Sent: Friday, May 26, 2017 8:31 PM To: almasaeed2010/AdminLTE AdminLTE@noreply.github.com Cc: LarryTX LarryTX@outlook.com; Author author@noreply.github.com Subject: Re: [almasaeed2010/AdminLTE] Hyperlinks not working in control sidebar (#1502)

Hmmm... The only thing I can thing is to watch the developer tools console in your browser and see if something pops up. I just did the aside and only an ahref inside and it works fine.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/almasaeed2010/AdminLTE/issues/1502#issuecomment-304417693, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AABRB3fppFx5tRm0NG31xdMHjCLppeqEks5r93zJgaJpZM4NhW-n.

theresan commented 7 years ago

I got it working by removing an app.js and added the adminlte.min.js hope that helps. The old js was depreciated.

larry-tx commented 7 years ago

Thanks for the response. Unfortunately, it came a bit late for me. I got frustrated and created my own admin theme (which I actually like better than AdminLTE). At least this way, I don’t have to put up with vagaries such as this.

From: theresan [mailto:notifications@github.com] Sent: Friday, June 23, 2017 7:07 PM To: almasaeed2010/AdminLTE AdminLTE@noreply.github.com Cc: LarryTX LarryTX@outlook.com; Author author@noreply.github.com Subject: Re: [almasaeed2010/AdminLTE] Hyperlinks not working in control sidebar (#1502)

I got it working by removing an app.js and added the adminlte.min.js hope that helps. The old js was depreciated.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/almasaeed2010/AdminLTE/issues/1502#issuecomment-310798220, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AABRBxZM5VtjeNMIgQimzCfdWzBVlpX0ks5sHFMXgaJpZM4NhW-n.

theresan commented 7 years ago

Wow you must be clever :) Is your version similar with responsiveness etc.