2

Using Sitecore JSS placeholder tag will generate a div, which is different from developing with Sitecore MVC. Is there a way to avoid generating these div tags? I followed Sitecore documentation: JSS placeholder documentation

Here is the code used and html generated:

Promo Container

image <Placeholder name='app-promos' :rendering="rendering"/>

Promo Card

enter image description here

Page Layout YAML

> placeholders:
      app-promos:
        - componentName: PromoCard
          fields:
            heading: PromoCard1
            image: 
              src: /data/media/img/promo-card-1.jpg
              alt: card1
            text: Card 1 desc...
            headline: Card 1
        - componentName: PromoCard
          fields:
            heading: PromoCard1
            image: 
              src: /data/media/img/promo-card-2.jpg
              alt: card2
            text: Card 2 desc...
            headline: Card 2
        - componentName: PromoCard
          fields:
            heading: PromoCard1
            image: 
              src: /data/media/img/promo-card-3.jpg
              alt: card3
            text: Card 3 desc...
            headline: Card 3

Generated HTML

image

Even the JSS sample code has the non-sense div generated.

1
  • Hey @MayZ. Welcome to Sitecore community. Please add the code in textual form not as images. Regarding your question - What about setting class=columns probably as className='columns' on Placeholder itself?... – Peter Procházka Apr 23 at 8:40
0

Finally got the answers from JSS official. Answers from JSS official

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.