Ad

OCtoberCMS Blog Plugin Rainlab

When i create a new Post and write in the excerpt, the post image on the news page just dissappears . It only works if i have no excerpt. Also .. How can i create new posts with existing classes already written in my css?

Without the excerpt ir works just fine. Showing image and text that i add on the post.

My code

<section id="content">

        <div class="content-wrap">

            <div class="container clearfix">



          <div  class="row"> {% component 'blogPosts' %}


          </div>



            </div>

        </div>

    </section><!-- #content end -->
Ad

Answer

When not defining an excerpt, a summary attribute is appended to the model. See https://github.com/rainlab/blog-plugin/blob/master/models/Post.php#L344 . If your content starts with an image, it might be that the summary function kicks in and generates the image.

As for the CSS part

I think you're looking to override the partial set by {% componenent 'blogPosts' %}. As per the docs (https://octobercms.com/docs/cms/components#overriding-partials)

All component partials can be overridden using the theme partials. If a component called channel uses the title.htm partial. We can override the partial by creating a file in our theme called partials/channel/title.htm.

Alternatively you can cmd / ctrl + doubleclick to expand the default component markup inside the CMS editor.

In this way you can edit your markup to match your theme.

Ad
source: stackoverflow.com
Ad