Added theme not showing up in page types
Created 7 years ago by minkyov

Hello,

I have followed the videos on theme creation and development but I faced a few problems. When I add the theme I can use it as a starter page but if I want to create a page with the theme as it's layout I don't have the theme showing up (I only have the default). The other problem is that I added a picture in the theme resource folder and I have accessed it from css as a background using background: url(the path to the picture) and some other options and it gets displayed just fine. Then I had to create another css class with absolutely the same settings but a different picture and when I did that the picture didn't get displayed. I have tried rewriting everything from scratch, I have changed the picture to another and nothing happens.

ryanthompson  —  7 years ago

I assume you're referring to layouts not the theme? Can you send me the file listing of your-theme/resources/views/layouts so I can see what might be happening? You activated the theme in settings or .env file right?

For images in CSS - try using asset_path. This way you won't have a URL in your compiled CSS.

{{ asset_path('theme::img/my-bg.jpg') }}

You can use that with the CSS just mind your double / single quotes!

minkyov  —  7 years ago

In the layouts file I have only default.twig with,

{{ trans(template.meta_title) }}

{{ asset_add('site.css', 'anomaly.theme.aubgolympics::styles/style.css') }} {{ html_style(asset_path('site.css')) }}, inside. I don't think I have it activated. How can I do that?

ryanthompson  —  7 years ago

You can activate the theme in settings.