Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All themes in public/themes #95

Open
blissgrn opened this issue Jul 18, 2018 · 9 comments
Open

All themes in public/themes #95

blissgrn opened this issue Jul 18, 2018 · 9 comments

Comments

@blissgrn
Copy link

Hi,

I'd like more information about this topic : #38
Indeed, I'd like to have all my themes under public/themes folder
Is it possible to configure something like this :

// VIEWS
'themes_path' => null,
// ASSETS
'assets_path' => 'themes'

Instead of having to configure the path for each themes:
'themes' => [
'main' => ['asset-path' => 'themes/main'],
'example1' => ['asset-path' => 'themes/example1'],
'example2' => ['asset-path' => 'themes/example2'],
];

Thank you :)

@sergejostir
Copy link

sergejostir commented Dec 9, 2019

I would also find this very useful, since I would like to make my asset path relative to public/themes and not to /public as it is now by default.

@blissgrn
Copy link
Author

blissgrn commented Dec 9, 2019

Hi @sergiz

It's been a while and not sure I remember everything but if it can help you, here what I finaly did.

In each theme.json :
{
"name": "my-custom-theme-1",
"extends": "my-parent-theme",
"asset-path": "themes/my-custom-theme-1"
}

I believe I did not change anything in the config/themes.php, which I found more convenient.

'themes_path' => null,
[...]
'themes' => [],

Cheers.

@igaster
Copy link
Owner

igaster commented Dec 9, 2019

@blissgrn unfortunately you can only configure the location for the views, but not for the assets. You are right that you can achieve a similar result by placing a json file inside the theme (views) folder

@sergejostir
Copy link

sergejostir commented Dec 9, 2019

@blissgrn
That's what I want to avoid (and I guess you did too, considering your original post). Currently there is no way to implicity have asset path set to something else than public/, so you have to define it manually for every theme.
With a new configuration option that you proposed, we could avoid that (and avoid even having to make theme.json for every theme).

@igaster
Copy link
Owner

igaster commented Dec 9, 2019

theme.json is optional. You can just use the config/themes.php file to configure your themes. (This is IMO a better approach)

The json file was developed as a feature to make the themes portable between applications with no external configuration dependencies

@igaster
Copy link
Owner

igaster commented Dec 9, 2019

I will not close this issue, because I think that it could be a good feature to add in the future

@sergejostir
Copy link

I know theme.json is optional, but if you don't want your themes assets building up in public/, then in it is de facto not optional anymore since you cannot globally define for all assets to be in for example public/themes/.

It is a pretty minor change to add default assets path configuration option (like we have for views), but it would make things much nicer (I guess I'm not the only one that likes to keep theme assets in a subdirectory, not directly in public/).

@oasin
Copy link

oasin commented Mar 17, 2020

Is there an update regarding this?

@szwss
Copy link

szwss commented Jul 19, 2024

Me too, same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants