Modules plugin: CSS file for each module

@lukasbestle & @sashtown:

Thank you very much for this great plugin!

I have installed it and the demo branch.

But the css-files aren’t loaded.
What is the best solution, to add these files to the corresponding webpage, if I don’t want to use the Patterns plugin?

To add e.g.

  <?php echo css('site/modules/text/text.css'); ?>

in the header.php snippet don’t works because of the .htaccess file rule “block all files in the site folder from being accessed directly”.

The best way would be a build process using a tool like gulp or Grunt. You can then combine all CSS files with a wildcard like site/modules/*/*.css into a single file, minify that and place it in the assets directory.

1 Like

Thank you @lukasbestle, that is a way. I can use the Sass plugins for Kirby v2.

But I dream of an extension of the Modules Plugin that works like Kirby does it for assets of plugins, known as Public URLs for plugin assets

You can build a route that does this yourself, but please note that it isn’t good from a performance perspective (at least until HTTP/2) to use many small asset files.

1 Like

ok, but my knowledge of how to build that route is to low :cry:

You can take a look at this example for the plugin assets. :slight_smile:

1 Like

Thank you very much for your always quick reply.

I will try soon… :slight_smile: