OctoberCMS How to Preview
I have a controller implements Backend\Behaviors\FormController
and Backend\Behaviors\ListController
I'm able to update or delete selected records from the list (delete by clicking the delete button and update by double click), however, I can't find a way to add preview link to the list and I can't find that mentioned in the documentation. Maybe the answer is easy but I'm still missing it.
I'm able to preview any records if I enter the preview link manually in the URL bar. e.g.
http://my-project.dev/administration-backend/walid/my-plugin/model/preview/1
I just want to add the above preview link next to each record in the list.
Thanks in advanced.
Answer
Based on the comments above, the only way to do it is by list partials:
You should define custom list column, quoting OctoberCMS documentation:
Partial
partial
- renders a partial, the pathvalue
can refer to apartial
view file otherwise the column name is used as the partial name. Inside the partial these variables are available:$value
is the default cell value,$record
is the model used for the cell and$column
is the configured class objectBackend\Classes\ListColumn
.content: type: partial path: ~/plugins/acme/blog/models/comments/_content_column.htm
Related Questions
- → October CMS Custom Mail Layout
- → How to register middlewares in OctoberCMS plugin?
- → How to add default value in drodown in october cms?
- → Redirect wrong url laravel 5.1
- → laravel blade templating error
- → Get environment value in controller
- → After copying Laravel from one PC to another it shows a strange error from helpers.php
- → Laravel 5.1 page authentication using routes
- → Trait 'IlluminateFoundationBusDispatchesJobs' not found
- → How to fix error while installing Laravel first time?
- → How to eager load and query a pivot table using Eloquent - Laravel 5
- → Any advantages of adding an id column to a pivot table in Laravel?
- → Laravel 5 Cashier Middleware Routing Error