Adding a class to a new asset

how can I add a class to a new asset?

<?= (new Asset("assets/images/TOW3.svg"))->content() ?>

Since you are reading the file contents, you can’t.

Options:

  • add the class to svg
  • wrap the code above in a container with a class attribute
  • apply class via javascript

How can I apply a class to the svg?

It’s just a text file, you can open it with any text editor.

1 Like

Ahh yes I understand. Thank you