Preview Modules

Hey how do you go about previewing modules? There is not a lot of documentation available. How do you handle route. When you click on the route that is generated by the backend for instance http://localhost:9000/en/pages/intro the result is not found. If i add a route which routes to the view located at the /site/modulename.blade.php it returns an error $item not found.
I
ifox360d ago
hi @.zeenux there's no route needed to preview inside the CMS, it is returning the view with a $item variable which is the previewed record. Now of course you'll want a route in your frontend routes to access the record, but if you want to use the same view for the preview and the frontend site, you'll need to send a $item variable from your frontend controller to that same view.
Z
.zeenux360d ago
I can't preview when i click on the generated link? It returns file not found.
I
ifox360d ago
the generated link is customizable and needs to have a corresponding route in your frontend, I was talking about the "Preview changes" link you may not want 'pages' in your frontend url for example, so for that you should use setPermalinkBase('') then you need to think about how you are managing the locale slug in your frontend routes
Z
.zeenux360d ago
Thanks @ifox.dev. as a side note how do you access the attached files in the $item collection? dd doesn't show them.
I
ifox360d ago
$item->files('name_of_your_field_name')
Z
.zeenux360d ago
@foreach ($item->filesList('video') as $f )
Want results from more Discord servers?
Add your server
More Posts
Legacy Settings Sections return values doesn't workHi, After save Settings to database, values doesn't bind in inputs. How fixed this @ifox.dev ?New module item errorWhen i make a new module i get this error, i'm using the twill metadata pacakage ```Object { messagCustom form fieldsI'm trying to make a custom form field to override the custom WYSIWYG form field. I've followed thiNew Settings approachHey, a i have a small question - how build a settings page like in https://demo.twill.io/settings/seRender repeater in block blade fileI have made a block named "gallery" with a repeater containing medias named "gallery-item", please hFetch all images in a blockHow do you fetch all the images in a block? For e.g i have this block <x-twill::medias name="slRepeater without blocksHow do you add and render a repeater without including it in the block?Adding custom blocks to modulesHow do you add custom blocks to modules? Generally i add blocks to a module using $form->add(BlockEd$renderData returns null when trying to render nestedblocks@php /** @var \A17\Twill\Services\Blocks\RenderData $renderData */ dd($renderData) Fetch all models with field value of XSorry to ask such a basic question but I want to do the following.... I have a model called Work (anDisplaying Block elements on the Front Pagehow do you display block elements on the frontpage? And i don't mean the preview file. I want to accdashboard routeHello. I have a problem with dashboard config I have a Category and CategoryArticle Models I have aTwill Role based accessHow would i go about adding a Role based access to CMS Components and its entries. For e.g in an imaTwill assets errorHello to everyone i have an website in production builded in twill but some twill assets in there aWhere to find block repositories?I've seen in the tutorial(https://www.youtube.com/watch?v=kAcJ5G2GhiA) some blocks like "paragraph &[3.0.0] Block class - getBlockTitle()Hi, I was trying to move Blade blocks to Class. When I wanted to move `@twillBlockTitleField` in cla[3.0.0] componentBlock overriding getBlockIcon doesn't seem to work?(Successfully changed the title by overriding it's static function) Checked twill:list:icon for the[3.0.0] Maintaining automated Permalink Generation when using getCreateForm to add fields.As soon as I add any fields, using the Formbuilder on this function, the automated permalink disappemulti select selected optionsI'm using the multi select as documented in https://twill.io/docs/form-fields/multi-select.html#mult[3.0.0-rc4] - How to show current value in a select form fieldCurrently I have my select field defined as: `@formField('select', [ 'name' => 'work_year',