Giter Site home page Giter Site logo

New Menu Layout about laravel-menu HOT 3 CLOSED

lavary avatar lavary commented on August 17, 2024
New Menu Layout

from laravel-menu.

Comments (3)

enigmatic-user avatar enigmatic-user commented on August 17, 2024

Do yourself a favor and don't use tables for that (or anything that is just layout). That's what CSS is for.

Basically you have to "float" the list items. You'll find a very basic and easy to follow tutorial on http://www.w3schools.com/css/css_navbar.asp. But the web is full of tutorials for things like this - just give the search engine of your choice a chance! :)

from laravel-menu.

lavary avatar lavary commented on August 17, 2024

You can use Bootstrap for rendering the menu as a horizontal navigation bar. The package provides a Bootstrap based view out of the box.

As an example:

<?php

Menu::make('main', function($m) {
    $m->add('Home');
    $m->add('About', 'about');
    $m->add('Services', 'services');
    $m->add('Contact', 'contact') ;
    $m->add('Portfolio', 'portfolio');
}); 
<nav class="navbar navbar-default" role="navigation">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Brand</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">

       @include(Config::get('laravel-menu::views.bootstrap-items'), array('items' => $main->roots()))

      </ul>
      <form class="navbar-form navbar-right" role="search">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search">
        </div>
        <button type="submit" class="btn btn-default">Submit</button>
      </form>

    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>

It is fully covered in the documentation: Menu as Bootstrap 3 Navbar

If you don't want to use Bootstrap, the example should give the idea of building a horizontal navigation bar.

from laravel-menu.

lavary avatar lavary commented on August 17, 2024

Closing the issue, please feel free to reopen if needed.

from laravel-menu.

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.