cant create my own theme

If copy startup-theme and paste it and then change folder name to something else for example matt and then change it in the _config/theme.yml and then i do a /dev/build?flush=all then it stops working unless i change back to orginal theme and do again /dev/build?flush=all it works

Can you expand on “stops working” a bit?

Are there error messages? What actually happens

the css stops working

when i change it to the following:


Name: mytheme

SilverStripe\View\SSViewer:
themes:

  • ‘$public’

  • ‘met’

  • ‘$default’

    just changing the startup-theme folder namde and do this change website css stops working

The new folder in theme is just copy of startup-theme but with different name. Same files.

If I just want to change the folder name, what do I need to do?"

From startup-them to something else

Just changing the theme folder name shouldn’t break the website.

I should be able to create multiple themes.

OK. So, the issue here may be that the resources haven’t been updated. Silverstripe “exposes” assets by copying or symlinking them into the public directory. This allows modules from throughout the project to deliver assets like CSS without having a bunch of directly available files in your webspace.

In the composer.json file for the theme, you will likely see a section called “expose”. This tells the system what files to make publicly available. ( Requirements | Silverstripe CMS Documentation )

If you have renamed the directory, then the symlinks are probably now broken. Have you tried running composer vendor-expose after you made the changes?

I have created a file called create_symlink.php that creates symlink folders, and now it works.

There should be no need to create any special / custom functionality for this. The vendor-expose operation is designed for the job. It will expose any assets that are needed from all the modules and themes that are in use.

You need access to bash, which I don’t have access to.

The alternative is to run composer vendor-expose copy on your local machine, and then just upload all the files in the resources directory. That version of the command copies the files over rather than symlinking.