How to disable css loading from blocks on the page?

Hi there,

I’m building my own custom theme and I see some css and js files loaded in the header because I use some blocks like the navigation and form block, they both load a .css file that is not used, but I can’t figure out how to disable it from loading it anyway.

How do I fix this?

Options available, use in whatever combinations make sense. Most themes only need (1)

  1. If your theme provides your own block templates, and those templates include a view.css, your own view.css files will be loaded in preference to the core css for the blocks.
  2. Your theme’s page_theme.php can declare that your theme provides all css and js for specific features. The core will then leave all support for those features up to you.
  3. You can add/remove sitewide stuff that gets loaded in you theme’s header_top and footer_bottom. Usually better for adding rather than removing.
  4. Concrete has an event system. You can use that to intercept and in many cases modify what is happening Full Event List :: Concrete CMS

Thank you for the response! I would like to use option 2, as that looks to be cleanses way. I tried to change it myself already but it did not work.

I tried this code, is this the correct method within the page_theme?
public function registerAssets() {

$this->providesAsset(‘css’, ‘core/features/imagery/frontend’); $this->providesAsset(‘css’, ‘core/features/basics/frontend’);

$this->providesAsset(‘css’, ‘core/features/navigation/frontend’);

$this->providesAsset(‘css’, ‘blocks/form’);

$this->providesAsset(‘css’, ‘core/frontend/form’); // Soms gebruikt als alias }

When you provide an asset, it needs to provide all parts of the asset that could be used on the front end. So is ideally a theme built on Concrete bedrock. Have a look at how Atomik does it, then check some of the free MP themes that are built on bedrock.

Assets within features are Assets and Features :: Concrete CMS

There are several historical forum threads about building a bedrock theme.