开发者

Magento - Change background image based on country selected

I have just been on next.co.uk and liked the way that they change the top right corner of their website when languages are selected. I.e. if you go on the german version you will see the website corner peeled over with a german flag behind it.

I was wondering if magento had anyway to do this as there is no chang开发者_C百科e to the actual markup when the language is changed.

If it was possible to give the body a class depending on the language selected e.g. body class="german" then this would be ideal for styling pages to suit foreign layouts.

Any help will be appreciated.

Thankyou

Glynn Roco Clothing


Magento does this already with the themes for French, German and English in 'demo store'.

What happen is that you have a base theme - the one you have worked on - and an over-ride theme, just the extras found in your skins/frontend/default/country and app/design/frontend/default/country folders. You do not need a complete clone of your base theme, just the updates.

You can also use normal linux soft links in your server, your styles.css could refer to a ../images/bg.png file that is different on each theme with the styles.css being the same.


You could try doing a store ID check and then modifying your HTML depending on the language of the store i.e.

<?php if (Mage::app()->getStore()->getId()==2): ?> // German Store
<body class="german">
<?php else: ?>
<body class="english">
<?php endif ?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜