Giter Club home page Giter Club logo

Comments (4)

SeriousKen avatar SeriousKen commented on September 22, 2024

Figured out where the difference occurs - line 281 in the PageActions trait. When setting the num prop directly the logic says that it doesn't need sorting.

// don't sort if not necessary
if ($this->status() === 'listed' && $num === $this->num()) {
return $this;
}

from kirby.

afbora avatar afbora commented on September 22, 2024

I have not an idea about the fixing the issue but as workaround you can use 'num' => 0 to create pages with reverse order.

from kirby.

SeriousKen avatar SeriousKen commented on September 22, 2024

@afbora yes, setting num to 0 does work but I just needed some example code to highlight the issue. Something needs fixing somewhere, but not sure if it is code or documentation. There is an inconsistency in using num in the props vs setting it after creation with changeStatus, and I think changeStatus after creation is probably the more understandable way, but num is documented as a prop and the difference in the behaviour is not obvious.

from kirby.

SeriousKen avatar SeriousKen commented on September 22, 2024

Seems that setting draft to false in conjuction with setting num is causing the issue, setting num doesn't need draft as false anyway as it sets the status to listed so should there be a warning in the docs about not using both settings together?

from kirby.

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.