Apostrophe CMS Main Site Forum Home

How to truncate rich text body


#1

dears,

i need help in truncate a text from rich text as below please i tried many but useless

{% for piece in data.pieces %}

                        <div class="col-md-4 col-sm-6">
                            <div class="single-product mb-55 animated fadeInUp" data-animate="fadeInUp" data-delay=".1" style="animation-duration: 0.6s; animation-delay: 0.1s;">
                                <span class="tip">{{ piece.title }}</span>
                                <img src="img/products/product1@2x.jpg" data-rjs="2" alt="" data-rjs-processed="true" width="237" height="193">
                          
                                <h3 class="h5">
                                   {{ apos.area(piece, 'body') }}
                                </h3>
                              
                            </div>
                        </div>
                      
                        <!-- End of Single Product -->
                    {% endfor %}

i need to truncate this part i don’t know if there is other way to display the description and how i can add fontsize and fontfamilly to rich text

{{ apos.area(piece, ‘body’) }}

thanks in advance


#2

i got the solution and i don’t find how to flag it please close it