Giter Site home page Giter Site logo

Comments (5)

voidgraphics avatar voidgraphics commented on September 15, 2024

I have an idea: what if those "option forms" (needs a better name, btw) were defined in the config file, in an array, and were loaded automatically by the package?

We could even have a multi-depth array, to be able to specify which routes the option form should be loaded for. Something like:

'options' => [
    '\App\Nova\Options\CookiesBanner' => '*', // load it for all routes
    '\App\Nova\Options\ContactInfo' => ['home', 'contact']
]

I know that we use Middleware to achieve this with Templates, but I think these are a little too specific to work the same way, since you don't want to load all of them for every page.

And another nice feature we could have is a specific artisan command to generate these, and they would automatically add them to the array in addition to creating the right file.

from nova-page.

toonvandenbos avatar toonvandenbos commented on September 15, 2024

Issue was closed by mistake.

from nova-page.

wimurk avatar wimurk commented on September 15, 2024

This would be awesome. I can create widgets or small cards with text without having to create routes and controllers.

For the home page where there is a lot of text the edit page drives me crazy with the amount of fields. I would like to split it up and be able to use it on other pages.

from nova-page.

raphcollective avatar raphcollective commented on September 15, 2024

@voidgraphics @Nyratas I could try to take care of this, do you have a more precise idea of how you wanted this to be implemented? How would you deal with the $current variable in the Manager for example?

from nova-page.

toonvandenbos avatar toonvandenbos commented on September 15, 2024

Option templates have been added.

It is now possible to register option templates (or regular route templates) in ServiceProviders, like this:

use Whitecube\NovaPage\Pages\Manager;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    public function boot(Manager $pages)
    {
        $pages->register('option', 'footer', \App\Nova\Templates\FooterOptions::class);
    }
}

This new feature will be shipped in next release, v0.2.3.

from nova-page.

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.