简体   繁体   中英

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 -->

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.

If you want to override markup there is really easy way. for image @CptMeatball added proper answer you can check that out.

This way you have full control on mark-up and you can edit it.

1. Click on expand component it will reveal mark-up of component

在此输入图像描述

2. Now you can add your own markup and edit it.

在此输入图像描述

if any doubt please comment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM