cancel
Showing results for 
Search instead for 
Did you mean: 

Saving content in a block

SOLVED

Saving content in a block

I am trying to save below code in a block. 

<div class="row">
    <div class="col-sm-12">
        <a href="#" class="fa fa-facebook"></a>
        <a href="#" class="fa fa-twitter"></a>
        <a href="#" class="fa fa-google"></a>
        <a href="#" class="fa fa-linkedin"></a>
        <a href="#" class="fa fa-youtube"></a>
        <a href="#" class="fa fa-instagram"></a>
        <a href="#" class="fa fa-pinterest"></a>
    </div>
    <div class="col-sm-12">
        <div class="">
            <p class="">&nbsp;</p>
            <div class="newsletter-wrapper" style="margin-right: 10px;">
                <div class="newsletter-container">{{block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe" as="subscribe" before="-" template="subscribe.phtml"}}</div>
            </div>
        </div>
    </div>
</div>



But after saving content disappeared.


Why it is happening like this ?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Saving content in a block

Hello @foysal 

 

It's because there is no data between your tags (<a>, <p>, <div>), try to add some data which you need in that block then it won't disappear.

It's because it clean up the data which have nothing to show or to do. for example I added some data in your code and it didn't get disappear later.

<div class="row">
    <div class="col-sm-12">
        <a href="#" class="fa fa-facebook">facebook</a>
        <a href="#" class="fa fa-twitter">twitter</a>
        <a href="#" class="fa fa-google">google</a>
        <a href="#" class="fa fa-linkedin">linkedin</a>
        <a href="#" class="fa fa-youtube">youtube</a>
        <a href="#" class="fa fa-instagram">instagram</a>
        <a href="#" class="fa fa-pinterest">pinterest</a>
    </div>
    <div class="col-sm-12">
        <div class="">
            <p class="">A Paragraph Tag</p>
            <div class="newsletter-wrapper" style="margin-right: 10px;">
                <div class="newsletter-container">{{block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe" as="subscribe" before="-" template="subscribe.phtml"}}</div>
            </div>
        </div>
    </div>
</div>
Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

View solution in original post

1 REPLY 1

Re: Saving content in a block

Hello @foysal 

 

It's because there is no data between your tags (<a>, <p>, <div>), try to add some data which you need in that block then it won't disappear.

It's because it clean up the data which have nothing to show or to do. for example I added some data in your code and it didn't get disappear later.

<div class="row">
    <div class="col-sm-12">
        <a href="#" class="fa fa-facebook">facebook</a>
        <a href="#" class="fa fa-twitter">twitter</a>
        <a href="#" class="fa fa-google">google</a>
        <a href="#" class="fa fa-linkedin">linkedin</a>
        <a href="#" class="fa fa-youtube">youtube</a>
        <a href="#" class="fa fa-instagram">instagram</a>
        <a href="#" class="fa fa-pinterest">pinterest</a>
    </div>
    <div class="col-sm-12">
        <div class="">
            <p class="">A Paragraph Tag</p>
            <div class="newsletter-wrapper" style="margin-right: 10px;">
                <div class="newsletter-container">{{block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe" as="subscribe" before="-" template="subscribe.phtml"}}</div>
            </div>
        </div>
    </div>
</div>
Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy