3

I am beginner and testing Magento 2.0.1 with the Luma template to setup a dual language shop. I have created a second Store view for the second language (German) but new blocks with same identifiers are simply not shown. I have followed the same approach as when creating new content pages earlier, which worked well and as expected. But not so for the content blocks e.g. "contact-us-info" or "footer-links-block" :-(

These are my steps:

  1. Limit the Store View of an existing block, e.g. "contact-us-info" to the "Default Store View" (English)
  2. Copy the contents of that block and create a new block with the same identifier for the second Store View (German). However, the block is simply not shown in the frontend after I switch to the second Store View in the frontend.

More puzzling: Even if I change the identifier e.g. from "contact-us-info" to "contact-Blabla__" the block is still shown as before! It appears the block identifier is not actually used at all (hard-linked?).

Question: How can I create a second (translated) contents block for a different Store View? What am I missing?? Could somebody please be so kind to drop me a hint what I am doing wrong?

1

did you add this block as a widget on a cms page?

I just testet it. The widget is saved with the actual block_id, this is why it always tries to access the same block (and can't do that when it is not in the store view).

you can manipulate the widget by deactivating the wysiwyg editor and then put the block identifier in the block_id var instead of the actual id.

Seems like a bug in the widget.

0

Not sure if this applies to Magento 2, but in 1.9x you'll need to render the blocks with ->toHtml to render them for the appropriate store view.

For more Info check out this answer on a similar question.

For clarification purposes you could provide some more code on how you'd render the static blocks in the frontend (layout file, .phtml, etc.)

  • Rob_st, thank you for your comments! Unfortunately I can't tell about the code, because I didn't touch that yet. It is the stock "Luma" template files, which come with the demo files of Magento 2. – Aron Feb 8 '16 at 14:59
0

Many thanks you Rob_st and espcially David for responding to my question and putting me on the right track by pointing me to the widget. I could solve my problem now - here is how:

The "trick" is, that in addition to creating new instances of the page and block for the new language site, it is also necessary to create a new instance of the "Footer Links" content Widget!

The same logic applies, as for creating the page and block translations:

  1. Create a new widget e.g. "Footer Links German" with the same contents as the original "Footer Links" widget
  2. Assign the "Default Store View" (instead of "All Stores View") to the existing "Footer Links" widget
  3. Under the widget options of the new widget, click "Select block ..." and point to the translation of the block, e.g. "Footer Links Block German", which needs to be created earlier.

After having put the missing widget in place all works perfectly well now! :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.