Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
Forum Replies Created
-
AuthorReplies
-
Sorry Daniel, I had to continue this through email. Here are some points that helped me solve the issue, that I didn’t get from the docs:
1. Be sure to set the theme in the Admin panel, not just in config.yml. Otherwise the ‘default’ theme (which is actually the id of Oro’s layout theme) overrides it.
2. The Quick Start docs work for Platform, but not for OroCommerce. When you set ‘groups’ in theme.yml, you need to include the ‘commerce’ group:YAML12345# src/E7/StoreThemeBundle/Resources/views/layouts/store/theme.ymllabel: E7 Store Themeicon: bundles/storetheme/themes/e7admin/images/favicon.pnggroups: [ main, commerce ]parent: default
UI Developer at E7 Solutions
http://www.e7solutions.comIs it possible my reference to the layout is not written correctly? It is in the same directory as the default. (everything else is directly copied from the Quick Start)
YAML123456789# src/E7/StoreThemeBundle/Resources/views/layouts/store/default.ymllayout:actions:- @setBlockTheme:themes: 'E7:StoreThemeBundle:layouts:store/default.html.twig'- @addTree:items:...
UI Developer at E7 Solutions
http://www.e7solutions.comUpdate: I’ve moved this post to the OroCommerce forum, as that is the application we are using. I’m not sure if implementing a layout theme changes between the CRM and Commerce. Find the post here: https://oroinc.com/b2b-ecommerce/forums/topic/issues-while-creating-a-layout-theme
UI Developer at E7 Solutions
http://www.e7solutions.comApril 20, 2017 at 1:51 pm in reply to: Issues using a custom theme inside a bundle – CSS not pulled in #25637Alright, I can confirm that using assets.yml works. Here is mine:
YAML12345# src/E7/StoreThemeBundle/Resources/config/oro/assets.ymlassets:css:backend:- 'bundles/storetheme/themes/store/css/main.css'After placing this file in my bundle’s ‘Resources/config/oro’ directory, then doing cache:clear, oro:assets:install, and assetic:dump, my CSS was loaded in the Admin side.
I would suggest editing some of the documentation however, as it should be more clear that you have to use assets.yml when making a reusable theme.
UI Developer at E7 Solutions
http://www.e7solutions.comApril 18, 2017 at 6:32 am in reply to: Issues using a custom theme inside a bundle – CSS not pulled in #25636Sorry, I haven’t had time to work on this in a bit. I will try the assets.yml workaround later this week.
UI Developer at E7 Solutions
http://www.e7solutions.comApril 12, 2017 at 2:15 pm in reply to: Issues using a custom theme inside a bundle – CSS not pulled in #25635My understanding was that, if you create a theme properly, you don’t have to use assets.yml. You just declare all CSS/LESS in the settings.yml and they will append to the rest of the CSS assets. At least that’s what the docs here say:
When application has active theme it’s styles append to the end of the list of all CSS assets of bundles.
Each theme is appended to the list of OroAsseticBundle’s CSS assets in group “theme”.
…and the docs here mention assets.yml, but again declare that if you have CSS files referenced properly in your settings.yml then you’re good.
I will try using assets.yml tomorrow, but it seems redundant to reference the CSS files in both places.
UI Developer at E7 Solutions
http://www.e7solutions.comApril 12, 2017 at 6:47 am in reply to: Issues using a custom theme inside a bundle – CSS not pulled in #25633msulima –
Hi! This particular issue is within the OroCRM admin. I haven’t attempted store theming yet; I wanted to solve this first.
My issue is, at this point, all of the options for the settings.yml work properly except the CSS. When I inspect the admin page CSS, I see my rules aren’t applying. I’m trying to solve this issue before moving on to templates.
Thanks!
UI Developer at E7 Solutions
http://www.e7solutions.comApril 11, 2017 at 12:57 pm in reply to: Issues using a custom theme inside a bundle – CSS not pulled in #25631Edit 2:
I’ve been told that all the docs/tutorials I have been following only affect the Admin side. The way I understand it, this method of theming (specifically placing my theme in Resources/public/themes) loads the theme’s files on the Admin side, not the front-end. This is not stated in the docs, but I can confirm it’s true: I am now seeing my attempts at fixing or breaking things take effect while in /admin.
However, my problem with CSS persists. I even tried adding my own icon and updated the settings.yml:
YAML123456# src/SwagThemeBundle/Resources/public/themes/swag/settings.ymllabel: Swag Themeicon: bundles/swagtheme/themes/swag/images/favicon.pngstyles:- bundles/swagtheme/themes/swag/css/less/main.less- bundles/swagtheme/themes/swag/css/style.css…which sets the site favicon just fine! By this logic, the path to my CSS files should work perfectly, yet the content of my CSS files doesn’t load.
UI Developer at E7 Solutions
http://www.e7solutions.comApril 11, 2017 at 10:46 am in reply to: Issues using a custom theme inside a bundle – CSS not pulled in #25630Edit:
Apologies, the file tree above didn’t match my actual tree; I had omitted and renamed based on what I thought was necessary. Below is the full tree, which includes files copy-pasted from the Atwix article referenced above. I don’t know if they are necessary for my current goal. To clarify: My CSS files do not load, meaning the CSS rules I’m creating in them are not present in the resulting styles.css file in the cached files.
12345678910111213141516171819202122232425src/└── E7/└── SwagThemeBundle/├── Controller/│ └── DefaultController.php├── DependencyInjection/│ ├── Configuration.php│ └── SwagThemeExtension.php├── Resources/│ ├── config/│ │ ├── oro/│ │ │ └── bundles.yml│ │ └── services.yml│ ├── public/│ │ └── themes/│ │ └── swag/│ │ ├── css/│ │ │ ├── less/│ │ │ │ └── main.less│ │ │ └── style.css│ │ └── settings.yml│ └── views/│ └── Default/│ └── index.html.twig└── SwagThemeBundle.php(I would have edited the first post but don’t see an edit button.)
UI Developer at E7 Solutions
http://www.e7solutions.com -
AuthorReplies