Hi,
I have a site with a LOT of blocks in a blocks field on one panel view. Is it possible to have these load as collapsed by default? I know they can be collapsed by clicking on the block title but it would be useful here to start off with them collapsed
             
            
              
              
              
            
            
           
          
            
            
              You can organise these with groupings Blocks | Kirby CMS
and set them to closed as required
             
            
              
              
              
            
            
           
          
            
            
              Ah sorry I wasn’t clear - I meant when the blocks are actually used in the field.
To be honest actually looking at it I don’t think this will be of use anyway, as there is no way of differentiating between the blocks when they are collapsed (e.g. all my blocks are type “Task”, and I can’t override this labelling with data from within the block)
             
            
              
              
              
            
            
           
          
            
            
              For the fields block type this solution was once shared on Discord:
panel.plugin('plugin/collapsed-blocks', {
  components: {
    'k-block-type-fields': {
      extends: 'k-block-type-fields',
      methods: {
        state(collapsed) {
          return true;
        }
      }
    }
  }
});
But you have to figure out how to handle the collapsed state if the user toggles a block. In my example, all blocks will be collapsed on reload.
https://discord.com/channels/525634039965679616/1214979722031931392/1215227723560001557
             
            
              
              
              
            
            
           
          
            
            
              Thanks for that it’s a great starting point.
Is there a way to override the block title with content from the block itself? For context this is a huge list of questions, so it would be good to have the question field used as the title so it is visible when collapsed.
             
            
              
              
              
            
            
           
          
            
            
              Does
label: "{{ yourQuestionFieldName }}"
work for you?