Giter Site home page Giter Site logo

nliautaud / pico-pages-list Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 8.0 129 KB

A pages lists plugin for Pico CMS, with nested pages, pages filtering and HTML navigation.

License: MIT License

PHP 100.00%
pico-cms picocms pico-plugin plugin navigation-tree nested-pages html-navigation

pico-pages-list's People

Contributors

jheimbach avatar matschundbrei avatar nliautaud avatar phrozenbyte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pico-pages-list's Issues

Sort Order for Pages List

It doesn't look like this plugin sorts the list according to $config['pages_order_by'] / $config['pages_order'] instructions. Should this plugin follow that default/declared sort config, or should it have its own config values (something like $config['pages_list_order'] ) for fine-tuned control?

Active index.md file not marked as is-active

Hi - similar to another issue - same same but different.

I have the following directory structure:

index.md
issueone/
        index.md
        anotherpage.md
issuetwo/
       index.md
issuethree/
       index.md
       moreissuethree.md
       issuefour/
             index.md
issuefive/
       issuefivepage.md

When I am looking at anotherpage.md or issueone/index.md, the list item containing the link has 'is-current' and 'is-active' classes. The containing folder list item is marked 'is-active'.

When I am looking at issuetwo/index.md, the list item containing the page link does not have either a 'is-current' or a 'is-active' class, and the parent folder list item does not have e is-active class.

When I am looking at issuethree/issue/four/index.md, the list ltem containing the page link does not have a is-active or a is-current class, but the list item containing the issuefour link does have a is-active class.

If there is an index.md, it seems the is-active and is-current classes are only added if there is also a sibling page or directory.

In the case of issuefive, the issuefive list item contains a span, and list item containing the issuefivepage.md link will have is-active and is-current classes. This makes collapsing the menu item tricky. It may be possible if you are clever enough.

Is this a bug or a feature :-)

Render and filter trough twig filters

A cleaner interface allowing access to both a flat and a nested array, that can be both filtered and rendered, may be trough twig filters. Something like :

{{ pages }} // flat list of pages
{{ pages | nested }} // nested list of pages/dirs
{{ pages | html_tree }} // render the given array
{{ pages | only: 'foo/bar' }} // filter the given array
{{ pages | exclude: 'foo/bar', 'other' }} // filter the given array
// ex :
{{ pages | nested | exclude: 'foo/bar', 'other' | html_tree }}

See picocms/picocms.github.io#11

How to install?

README says "copy the PHP file into the plugins folder and use the tag" but I tried that and it just outputs the tag.

Trying to access array offset on value of type null

Hey Nicolas

I installed the 3.0.0-alpha1 on my Webspace and added the learn2 Theme, which includes the PageList-Plugin.
It works fine, but after installing the PicoEditor i get this message:
Notice: Trying to access array offset on value of type null in /www/htdocs/domain.de/plugins/PicoPagesList/PicoPagesList.php on line 67
But the Editor is still working.
I posted this Issue here first: picocms/Pico#528
there is even a solution.

Unable to add filter "navigation" as extensions have already been initialized.

Hi, I just added the file to plugins, now it throws this below (using pico 2).

Fatal error: Uncaught exception 'LogicException' with message 'Unable to add filter "navigation" as extensions have already been initialized.' in <PATH>/vendor/twig/twig/lib/Twig/Environment.php:1103

Stack trace:
#0 /<PATH>/plugins/PicoPagesList.php(73): Twig_Environment->addFilter(Object(Twig_SimpleFilter)) #1 [internal function]: PicoPagesList->onPageRendering(Object(Twig_Environment), Array, 'help.twig')
#2 <PATH>/vendor/picocms/pico/lib/AbstractPicoPlugin.php(117): call_user_func_array(Array, Array)
#3 <PATH>/plugins/PicoDeprecated/PicoDeprecated.php(857): AbstractPicoPlugin->handleEvent('onPageRendering', Array)
#4 <PATH>/plugins/PicoDeprecated/PicoDeprecated.php(689): PicoDeprecated->triggerEvent(1, 'onPageRendering', Array)
#5 [internal function]: PicoDeprecated->onPageR in <PATH>/vendor/twig/twig/lib/Twig/Environment.php on line 1103

Any missing dependency, or what?

500 error when installed

Hi - installed on a couple of machines with picoCMS 2.0.4 and get following error:

[Thu May 9 20:31:51 2019] PHP Fatal error: Uncaught RuntimeException: Unable to load plugin 'pico-pages-list' from 'pico-pages-list/pico-pages-list.php': Plugin class not found in /var/lib/nethserver/home/don/htdocs/picocms/pico/vendor/picocms/pico/lib/Pico.php:669 Stack trace: #0 /var/lib/nethserver/home/don/htdocs/picocms/pico/vendor/picocms/pico/lib/Pico.php(520): Pico->loadLocalPlugins(Array) #1 /var/lib/nethserver/home/don/htdocs/picocms/pico/vendor/picocms/pico/lib/Pico.php(401): Pico->loadPlugins() #2 /var/lib/nethserver/home/don/htdocs/picocms/pico/index.php(33): Pico->run() #3 {main} thrown in /var/lib/nethserver/home/don/htdocs/picocms/pico/vendor/picocms/pico/lib/Pico.php on line 669

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.