chrisbeluga / kirby-navigation

Navigation field for getkirby.com
80 stars 12 forks source link

Composer install doesn't work #13

Closed MaluNoPeleke closed 3 years ago

MaluNoPeleke commented 3 years ago

I tried to add it in a section of a tab like this but got a message that navigation is not n available section type:

      - width: 1/2
        sections:
          navigation:
            label: Navigation
            type: navigation
            levels: 5
            help: Description of menu or where it is used

I am using Kirby 3.6.0-beta.1 and kirby-navigation 2.0.0 via composer.

afbora commented 3 years ago

You should use like that:

- width: 1/2
  sections:
    type: fields
    fields:
      navigation:
        label: Navigation
        type: navigation
        levels: 5
        help: Description of menu or where it is used
MaluNoPeleke commented 3 years ago

Then I get this message: image

afbora commented 3 years ago

I made a little mistake. Please try this one:

- width: 1/2
  sections:
    navigation:
      type: fields
      fields:
        navigation:
          label: Navigation
          type: navigation
          levels: 5
          help: Description of menu or where it is used
afbora commented 3 years ago

Related document: https://getkirby.com/docs/reference/panel/sections/fields

MaluNoPeleke commented 3 years ago

Still an error: image

afbora commented 3 years ago

So let me check in 3.6 please

MaluNoPeleke commented 3 years ago

Sure, maybe it is related to https://github.com/chrisbeluga/kirby-navigation/commit/bdb9d79cbb35072295597101880177d322a0f347

afbora commented 3 years ago

Could there be a problem with the indent of your YAML codes? The example below works fine in site.yml 3.6.

title: Site

columns:        
  - width: 1/2
    sections:
      navigation:
        type: fields
        fields:
          navigation:
            label: Navigation
            type: navigation
            levels: 5
            help: Description of menu or where it is used
MaluNoPeleke commented 3 years ago

I cannot see an issue with that: image

afbora commented 3 years ago

And make sure you are using 2.0.0 for 3.6.

https://github.com/chrisbeluga/kirby-navigation/releases/tag/2.0.0


Could it be conflicting with another plugin? Which plugins are you using?

MaluNoPeleke commented 3 years ago

I installed it via Composer:

$ composer require belugadigital/kirby-navigation Using version ^2.0 for belugadigital/kirby-navigation ./composer.json has been updated Running composer update belugadigital/kirby-navigation Loading composer repositories with package information Updating dependencies Lock file operations: 1 install, 0 updates, 0 removals

  • Locking belugadigital/kirby-navigation (2.0.0) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 1 install, 0 updates, 0 removals
  • Downloading belugadigital/kirby-navigation (2.0.0)
  • Installing belugadigital/kirby-navigation (2.0.0): Extracting archive Generating optimized autoload files

These are my installed plugins:

abraham/twitteroauth 2.0.2 The most popular PHP library for use with the Twitter OAuth REST API. belugadigital/kirby-navigation 2.0.0 Kirby 3 field for hierarchical menus with drag & drop level indentation. bnomei/kirby3-feed 1.4.2 Generate a RSS/JSON/Sitemap-Feed from a Pages-Collection bnomei/kirby3-fingerprint 3.0.14 File Method and css/js helper to add cachebusting hash and optional Subresource Integrity to file bnomei/kirby3-robots-txt 1.5.0 Manage the robots.txt from the Kirby config file bvdputte/kirby-autopublish v1.0 Kirby 3 plugin to schedule the automatic publishing of pages on a certain date+time. It is built to work w... claviska/simpleimage 3.6.3 A PHP class that makes working with images as simple as possible. composer/ca-bundle 1.2.10 Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle. diesdasdigital/kirby-meta-knight 1.2 Meta Knight – SEO for Kirby ezyang/htmlpurifier v4.13.0 Standards compliant HTML filter written in PHP filp/whoops 2.12.1 php error handling for cool kids flokosiol/focus 3.0.7 Better image cropping for Kirby CMS genxbe/kirby3-instagram 1.0.5 Kirby3 plugin to fetch instagram photos from your profile. getkirby/cms 3.6.0-beta.1 The Kirby 3 core getkirby/composer-installer 1.2.1 Kirby's custom Composer installer for the Kirby CMS and for Kirby plugins hashandsalt/kirby3-twitter dev-main 352a401 Kirby Twitter Plugin johannschopplich/kirby-highlighter v2.0.1 Server-side syntax highlighting for the Kirby code block & KirbyText kirbyzone/sitemapper 1.2.1 Kirbyzone's Automatic Sitemap Generator Plugin for Kirby laminas/laminas-escaper 2.7.0 Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs laminas/laminas-zendframework-bridge 1.4.0 Alias legacy ZF class names to Laminas Project equivalents. league/color-extractor 0.3.2 Extract colors from an image as a human would do. masterminds/html5 2.7.5 An HTML5 parser and serializer. medienbaecker/autoresize 2.1 Kirby Autoresize Plugin michelf/php-smartypants 1.8.1 PHP SmartyPants mustangostang/spyc 0.6.3 A simple YAML loader/dumper class for PHP phpmailer/phpmailer v6.5.0 PHPMailer is a full-featured email creation and transfer class for PHP psr/log 1.1.4 Common interface for logging libraries scrivo/highlight.php v9.18.1.7 Server side syntax highlighter that supports 185 languages. It's a PHP port of highlight.js sgkirby/commentions dev-develop d52ffd6 A versatile comment system and integrated Webmention endpoint for Kirby 3. sylvainjule/autofocus 1.0.2 Content aware image cropping for Kirby sylvainjule/matomo 1.0.6 Matomo helpers and panel sections for Kirby symfony/polyfill-mbstring v1.23.1 Symfony polyfill for the Mbstring extension symfony/polyfill-php80 v1.23.1 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions texnixe/similar 2.0.0 Find similar pages or files based on similarities between fields true/punycode v2.1.1 A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)

No errors are shown in the developer console.

afbora commented 3 years ago

It may take some time for me to try them all. Can you temporarily place the following codes in the site.yml file? Please make sure that site.yml contains only the following codes.

/site/blueprints/site.yml

title: Site

columns:        
  - width: 1/2
    sections:
      navigation:
        type: fields
        fields:
          navigation:
            label: Navigation
            type: navigation
            levels: 5
            help: Description of menu or where it is used
MaluNoPeleke commented 3 years ago

That gives me the same error:

image

afbora commented 3 years ago

I've installed all plugins that you have and still working 🤔

Another idea came to my mind. Can you try v2 by manually downloading and installing it to the plugins folder, not with composer, please?

https://github.com/chrisbeluga/kirby-navigation/releases/tag/2.0.0

MaluNoPeleke commented 3 years ago

That did the trick and showed me that there is no "kirby-navigation" folder in the plugins folder but in the vendor folder instead. I think the composer.json needs to be fixed for this.

MaluNoPeleke commented 3 years ago

Did I do it correctly? https://github.com/chrisbeluga/kirby-navigation/pull/14

afbora commented 3 years ago

@MaluNoPeleke I've closed the issue but could you try install 2.0.1 via composer please: https://github.com/chrisbeluga/kirby-navigation/releases/tag/2.0.1

MaluNoPeleke commented 3 years ago

I can confirm that it works now via composer as expected :)