Comments (5)
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.
Issue was closed by mistake.
from nova-page.
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.
@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.
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)
- Class "Route" not found
- Class "App" Not Found
- Method App\\Nova\\Templates\\Formations::forceFill does not exist HOT 4
- Title will not save in templates HOT 5
- Using with Ebess\AdvancedNovaMediaLibrary
- use the laravel new lang folder path instead of the old one
- Compatibility with Laravel 11
- Page Resource Search does not work
- FR: Hide options from sidebar HOT 2
- Ability to hide nova-option HOT 1
- Detail view broken HOT 7
- Cast Date Field HOT 3
- PHP 8 Compatibility? -- Required parameter follows optional parameter HOT 2
- Remove template declaration in routes HOT 3
- Arabic encoding
- Nova 4 Support HOT 6
- TypeError: Cannot read properties of undefined (reading 'resource') HOT 3
- Error deleting a file HOT 1
- Call to undefined method Whitecube\NovaPage\Pages\Query::exists() HOT 3
- Can this be used for multiple page layouts? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nova-page.