cancel
Showing results for 
Search instead for 
Did you mean: 

Quick win: add Magento store code to body class

0 Kudos

Quick win: add Magento store code to body class

Feature request from shirtsofholl, posted on GitHub Mar 26, 2015

Please add Magento store code to body class (as extra class)

Now we have route + page-name

cms-index-index cms-page-name

I suggest to add webstore code (or even domain/url) and/or both

cms-index-index cms-page-name store-en domain-com

What does it solve?

  • ability to set CSS per store view (so per language store-en)
  • ability to set CSS per domain (so per domain-com)

Maybe there is a better way. And there are ofcourse other methods to achieve someting like this - but it seems as a quick win ...

4 Comments
apiuser
New Member
Status changed to: Investigating
 
apiuser
New Member

Comment from godban, posted on GitHub Mar 27, 2015

Hello @shirtsofholl

As I understand, you want to manage different store views with one css(theme)? There is better way to manage store views styles and even domain styles in Magento 2 with themes. As example you can create new theme for each store view. Moreover you can define this theme as child of your base theme and keep your code DRY and more maintainable.

Detail info about theme creation you can find here http://devdocs.magento.com/guides/v1.0/frontend-dev-guide/themes/theme-create.html

apiuser
New Member

Comment from shirtsofholl, posted on GitHub Mar 27, 2015

Jep i understand

But sometimes one uses 1 theme for multiple store fronts. Being able to distinguish some CSS would be nice. And a simple addition for flexibility

Sent from my iPhone.

On 27 Mar 2015, at 11:18, Bogdan Plieshka notifications@github.com wrote:

Hello @shirtsofholl

As I understand, you want to manage different store views with one css(theme)? There is better way to manage store views styles and even domain styles in Magento 2 with themes. As example you can create new theme for each store view. Moreover you can define this theme as child of your base theme and keep your code DRY and more maintainable.

Detail info about theme creation you can find here http://devdocs.magento.com/guides/v1.0/frontend-dev-guide/themes/theme-create.html

— Reply to this email directly or view it on GitHub.

apiuser
New Member

Comment from godban, posted on GitHub Mar 27, 2015

@shirtsofholl I see

We have discussed your proposal and found it usable and good alternative for theme creation if you need a lot of small changes. Internal ticket MAGETWO-35529

We will keep you in touch about the progress, if you want to speed up process you can suggest pull request. Thank you for sharing your ideas!