Open evidencefrank opened 5 years ago
Hi @evidencefrank, you can call ->collapsed(false)
on your flexible field. This will open the layouts. We do not have the ability to open/close layouts individually at this time.
Hi @voidgraphics , thanks for the prompt reply.
I had tried the option ->collapsed(false)
but nothing seems to be changing. I still have to click the button to open a layout. I'm using this version "whitecube/nova-flexible-content": "^0.1.11"
.
Strange. From what I remember, they should be collapsed by default indeed, yet on my end they are open by default, which is not normal either. So very inconsistant with what you're describing. But from my tests, the collapsed
method works as intended.
I will reopen to further investigate. Do you have any JS errors in the console? Or errors in the Laravel log file? Can you share a more complete code example? Thanks
Hi @voidgraphics
This is the bit of code that i wrote and it is working fine except for the collasped option.
<?php
namespace App\Nova;
use Dukstra\MeetingDatetimepicker\MeetingDatetimepicker;
use Dukstra\MultipleUpload\MultipleUpload;
use Illuminate\Support\Facades\DB;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Fields\ID;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Trix;
use Laravel\Nova\Http\Requests\NovaRequest;
use Whitecube\NovaFlexibleContent\Flexible;
class Meeting extends Resource
{
use HasDependencies;
public function fields(Request $request){
return [
Flexible::make('Meeting` Details')
->addLayout('Meeting Details', 'wysiwyg', [
MeetingDatetimepicker::make('Date & Time', 'date_time')
->startDateTime($this->start_date)
->endDateTime($this->end_date)
->rules(['required']),
Text::make('Venue', 'venue')->hideFromIndex(),
Trix::make('Notes', 'notes')->hideFromIndex(),
MultipleUpload::make('Attachments', 'attachments')
->disk('s3')
->path('storage/meetingAttachments')
->maxSize(2)
->maxFiles(2)
->hideFromDetail(),
])//->fullWidth()
->limit(4)
->button('Add Another Meeting')
->collapsed(false)
->hideFromDetail()
->hideWhenUpdating()
->rules(['required']),
]
}
}
I also don't have errors in both the JS console and the Laravel Log file.
@voidgraphics any news on this issue ? :)
@voidgraphics Same here.
With not having a default Flexible that you can open. This would be a way to have at least not have to click the flexible button. Not working with: v0.2.6
Hi Guys. I have been using this package for quite a while now and its a very good package.
Recently i have been trying to set the layout to 'open' by default but can't seem to find any solution. I have limited the layouts to only four and would want one layout to be open by default without having to click a button.
Any assistance will surely be appreciated.