Download the PHP package gibbs/phile-sub-navigation without Composer

On this page you can find all versions of the php package gibbs/phile-sub-navigation. 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 phile-sub-navigation

PhileCMS Sub Navigation

A PhileCMS plugin that generates a hierarchy tree that can be used to make nested navigation menus.

1. Installation

Install via composer

Install via git

Clone this repository from the directory into . E.g:

Manual Install

Download and extract the contents into:

2. Plugin Activation

Activate the plugin in your file:

3. Parameters

This plugin returns a variable named . Each item in the site hierarchy has the following parameters:

4. Example Usage

To be flexible NO HTML is generated by this plugin - that is the responsibility of the template engine you are using.

More examples are available on the wiki

Children of a particular path, for example can be used by referencing the children key.

Twig - List /blog/ children

<ul>
{% for item in navigation.blog.children %}
    <li>
        <a href="{{ item.uri }}">{{ item.meta.title }}</a>
    </li>
{% endfor %}
</ul>

Twig - List /blog/archive/ children

<ul>
{% for item in navigation.blog.children.archive.children %}
    {% if item.active %}
    <li class="active">
    {% else %}
    <li>
    {% endif %}
        <a href="{{ item.uri }}">{{ item.meta.title }}</a>
    </li>
{% endfor %}
</ul>

Twig - Entire site hierarchy example

<!-- Twig Macro -->
{% macro sub_navigation(navigation) %}
    {% import _self as macros %}
    {% for item in navigation %}
        <li>
            <a href="{{ item.uri }}">{{ item.meta.title }}</a>
            {% if item.children %}
                <ul>
                    {{ macros.sub_navigation(item.children) }}
                </ul>
            {% endif %}
        </li>
    {% endfor %}
{% endmacro %}

{% import _self as macros %}
<ul>{{ macros.sub_navigation(navigation) }}</ul>

To debug the plugin output set inside the plugins file.

4. Caching

Caching is disabled by default and depends on (enabled by default).

To enable caching edit the plugins file and set cache to true.

NOTE: Caching will cause some parameters such as to stop working.


All versions of phile-sub-navigation with dependencies

PHP Build Version
Package Version
Requires phile-cms/phile Version >=1
phile-cms/plugin-installer-plugin Version >=1
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 gibbs/phile-sub-navigation contains the following files

Loading the files please wait ....