Answer the question
In order to leave comments, you need to log in
How, according to the BEM methodology, to correctly lay out such a section of the layout?
My version of bemjson.js, which I have no doubts about:
{
block : 'information',
content : [
{
block : 'telephone',
mods : { float : 'none' },
content : [
{
elem : 'phone-number',
content : '8 (831) 280-96-51'
},
{
elem : 'opening-times',
content : 'Пн-Пт: 9:00-18:00'
}
]
},
{
block : 'telephone',
content : [
{
elem : 'phone-number',
content : '8 (800) 555-18-38'
},
{
elem : 'additional-information',
content : 'Звонок по России бесплатный'
}
]
},
{
block : 'city',
content : [
{
elem : 'city',
content : 'Нижний Новгород'
},
{
elem : 'additional-information',
content : 'Доставка по городу и области бесплатная'
}
]
}
]
}
Answer the question
In order to leave comments, you need to log in
1. In BEM, so blocks. Therefore, leave the block as is block : 'information'. Here, after all, a block is literally written: information.
2. The question is not clear. Yes, there are no elements in the information block, but how does this relate to the second part of the question?
One way or another, you can make mixes in bemjson - that is, mix block elements to other blocks or blocks to elements of another block or block to block, etc.
3, 4. Yes, of course they should. Of course, you can leave the city element in the city block, but it is better to name the element name or title. And the opening-times element in the telephone block is a bit confusing. Maybe instead of a telephone block, make an information block element called section? As an option, I propose this, to get by with a single information block:
{
block : 'information',
content : [
{
elem: 'section',
mods : { float : 'none' },
content : [
{
elem : 'phone-number',
content : '8 (831) 280-96-51'
},
{
elem : 'opening-times',
content : 'Пн-Пт: 9:00-18:00'
}
]
},
{
elem: 'section',
content : [
{
elem : 'phone-number',
content : '8 (800) 555-18-38'
},
{
elem : 'additional-information',
content : 'Звонок по России бесплатный'
}
]
},
{
elem: 'section',
mods: { type: 'city' }
content : [
{
elem : 'city',
content : 'Нижний Новгород'
},
{
elem : 'additional-information',
content : 'Доставка по городу и области бесплатная'
}
]
}
]
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question