Coder Social home page Coder Social logo

Offcanvas widget about bootscore HOT 3 CLOSED

Schiehsl3 avatar Schiehsl3 commented on May 26, 2024 1
Offcanvas widget

from bootscore.

Comments (3)

crftwrk avatar crftwrk commented on May 26, 2024

Hi,

this is roughly hard-coded in top-nav widget position and header.php. Because there is not enough space in navbar to show buttons in mobile view, they moved to offcanvas while dark-mode switch is always in top-nav widget using display utilities.

Top-nav widget

Use a custom HTML widget in top-nav widget position:

<div class="d-flex">
  <div class="d-flex align-items-center me-2 me-lg-3">
    [bs-dark-mode]
  </div>
  <a class="btn btn-outline-primary d-none d-lg-block"href="https://bootscore.me/#download">Download</a>
  <a class="btn btn-dark ms-2 d-none d-lg-block" href="https://github.com/bootscore" target="_blank" title="bootScore @ GitHub" rel="noopener"><i class="fab fa-github"></i><span class="d-none"> GitHub</span></a>
</div>

header.php

You can show everything what you want in offcanvas, but hide it above the breakpoints using d-*-none class. Paste following HTML to your header.php in offcanvas direct after <!-- Bootstrap 5 Nav Walker Main Menu End -->.

<!-- Bootstrap 5 Nav Walker Main Menu End -->
<div class="d-lg-none mt-3 pt-4 pb-4 border-top">
  <div class="row">
    <div class="col-6">
      <a class="btn btn-outline-primary w-100 btn-download" href="https://bootscore.me/#download">Download</a>
    </div>
    <div class="col-6">
      <a class="btn btn-dark w-100" href="https://github.com/bootscore" target="_blank" title="bootScore @ GitHub" rel="noopener"><i class="fab fa-github"></i> GitHub</a>
    </div>
  </div>
</div>

Does this help?

from bootscore.

Schiehsl3 avatar Schiehsl3 commented on May 26, 2024

It does and it doesn't. It solved the question but I just wonder... why? Seems a little silly to have to custom coding it in. How come you never put it as a new widget type like Offset bottom widget? I am sure a lot of people would find use out of it to be there by default. Seems like something overlooked a bit

from bootscore.

crftwrk avatar crftwrk commented on May 26, 2024

bootScore is a starter theme for developers. You must code and edit it by yourself. We are here to help you and solve issues.

In my opinion, adding a widget in the offcanvas menu by default doesn't make sense. Some use the collapse menu instead offcanvas and you can't see widget in expanded navbar. In this case you have to deal with two different widget positions to show same content. One in offcanvas and one in expanded navbar.

This is something what you should do in your child. You can simply register as many widgets as you want and show them where you want.

from bootscore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.