Download the PHP package jainilnagar/navkit without Composer

On this page you can find all versions of the php package jainilnagar/navkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package navkit

Navkit for Craft CMS

A full-featured navigation and menu builder for Craft CMS 5 — multi-site, structured, translation-ready, with live-resolving links, per-menu custom fields, a cached front-end renderer, and GraphQL support.

Requirements

Installation

You can install Navkit via the plugin store, or through Composer.

Composer

You can also add the package to your project using Composer and the command line.

  1. Open your terminal and go to your Craft project:

    cd /path/to/project
  2. Then tell Composer to require the plugin, and Craft to install it:

    composer require jainilnagar/navkit && php craft plugin/install navkit

Craft Plugin Store

To install Navkit, navigate to the Plugin Store section of your Craft control panel, search for Navkit.

Concepts

Link types

A node points somewhere through one of the built-in link types — URL, Entry, Category, Asset, Product (when Craft Commerce is installed), or Passive (a label with no link). Element links resolve their URL live at render time, so when a linked entry's slug or URI changes, the menu updates automatically.

Add your own link types by listening for LinkTypes::EVENT_REGISTER_LINK_TYPES.

Rendering

The quickest path is the render() helper, which outputs a complete nested <nav>:

Options:

The default markup is unstyled but carries hook classes — navkit-nav, navkit-item, navkit-item--has-children, is-active, is-active-trail — plus aria-current="page" on the current item, so you style it in CSS.

To customize the markup, either pass a template path, or copy the plugin's templates into your own project at templates/navkit/_nav/menu.twig and templates/navkit/_nav/nodes.twig — your copies take precedence.

Raw access

For full control over the markup, query nodes directly and let the {% nav %} tag walk the tree. craft.navkit.nodes('handle').all() returns the nodes in structure order, and each node exposes isCurrent() (this node matches the current URL), isActive() (this node or a descendant is current), newWindow, and linkUrl:

Don't add .level(1) when using {% nav %} — the tag needs the full structure-ordered list to build the nesting.

Mega-menus & custom node fields

render() outputs the standard menu — link text, hierarchy, and active states. It works from a lightweight cached tree (id, title, url, type, target, newWindow, classes, rel, children), which deliberately does not include a node's custom field values. So any richer, custom-field-driven output — mega-menu panels, promo columns, images, descriptions — will not appear through render().

To render that content, use the raw craft.navkit.nodes() accessor instead, which returns full Node elements. Any field you've added to the menu's node field layout is then available as node.<fieldHandle>:

In short: render() for the standard menu; craft.navkit.nodes() in your own template for mega-menus and anything driven by custom node fields.

Caching

Rendered menu trees are cached per menu + site (enabled by default; toggle under Settings → Plugins → Navkit). The active-trail is computed per request, so the cache doesn't fragment by URL. Caches invalidate automatically when a node changes — or when an element a node links to changes — so a linked entry's slug change refreshes the menu with no manual clear.

GraphQL

Query a menu as a nested tree with resolved URLs:

Arguments: handle (required), and optionally site (site handle) or siteId.

Permissions

License

Navkit is licensed under the MIT License. See LICENSE.md.


All versions of navkit with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
craftcms/cms Version ^5.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jainilnagar/navkit contains the following files

Loading the files please wait ...