Displaying Block elements on the Front Page

how do you display block elements on the frontpage? And i don't mean the preview file. I want to access the block elements like $item->block like that.
I
ifox372d ago
$item->blocks is a collection of blocks
Z
.zeenux372d ago
so would $item->blocks('ckeditor')->render() would do the trick? because it doesn't for me
I
ifox372d ago
no that would be $item->renderBlocks() or renderNamedBlocks('block_editor_field_name') what are you trying to do with that ckeditor parameter though? Is that the name of one of your blocks?
Z
.zeenux372d ago
yes for instance i have a wysiwig editor and an image and a textbox in the blockeditor. I want to render all three of them in my template
I
ifox372d ago
so a subselection of blocks by their type? In that case you can do $item->blocks->whereIn('type', [...])->get() and iterate over that collection to include the view you want to render for each block type.
Want results from more Discord servers?
Add your server
More Posts
dashboard 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', [3.0.0-rc4] Images not found on remote server - League\\Glide\\Filesystem\\FileNotFoundExceptionI just went from my local to my remote server and some images are showing up others are getting a 5[Twill2] Do settings section support media and how?As title says, is it possible to inject media here or should I make a custom settings singleton to h[3.x.dev] Call to undefined method ReflectionUnionType::getName()Newbie to Twill here. Fresh install of Laravel 10.4.1 / PHP 8.2.4 / MYSQL 8.0.32 on Ubuntu Budgie 2Add custom icons into twillI add the icons into the path `resource/views/admin/icons` and I run the command, result is ok, but Select an another block in a block?Hi everyone, I have a function to create a new block with name "Columns block". With this block, usMedia Library / Glide only loading JPEGsHey there, So I had a Laravel/Twill app running successfully on a subdomain with no issue. Today IAdding a vue componentGood afternoon Tell me what could be the problem? On the main page of the admin panel there is an a