rainlab/blog-plugin

Variable in article view.

Thominho opened this issue · 2 comments

I need help with this problem, I want to view the first article in one section and the others in another. This solution of mine does not work.

My component

     {% set posts = __SELF__.posts %}       
        <section id="uvodniblog" class="divider">
    <div class="bt_feature_wrapper"> 
<!-- only one latest post -->
   {% for post in posts %}
    <div class="bt-feature-content bt_feature_main">
                        {% for image in post.featured_images|slice(0, 1) %} <div class="bt_item_img" style="background-image: url('{{ image.path }}');"></div> {% endfor %}
                        <a href="{{ post.url }}" class="bt_item_link" tabindex="-1"></a>
                        
                        <div class="slide_text_box">                    
                            <div class="meta-info-bg-color" style="color:w">
                                <a href="#" tabindex="-1" style="color:white;">..</a>
                            </div>
                            <h3>
                                <a href="{{ post.url }}" tabindex="-1">{{ post.title }}</a>
                            </h3>                                                                  
                             <div class="meta-info">                            
                                <ul>
                                    <li class="post-date">..</li>
                                </ul>
                            </div>
                        </div>
                    </div> {% endfor %} 
    
<!-- other post -->   
  {% for post in posts %}
    <div class="bt-feature-content bt-feature-small">
                        {% for image in post.featured_images|slice(0, 1) %} <div class="bt_item_img" style="background-image: url('{{ image.path }}');"></div>{% endfor %}
                        <a href="{{ post.url }}" class="bt_item_link" tabindex="-1"></a>
                        
                        <div class="slide_text_box">                    
                            <div class="meta-info-bg-color">
                                <a href="#" tabindex="-1" style="color:white;">..</a>
                            </div>
                            <h3>
                                <a href="{{ post.url }}" tabindex="-1">{{ post.title }}</a>
                            </h3> 
    
                            <div class="meta-info">                            
                                <ul>
                                    <li class="post-date">..</li>
                                </ul>
                            </div>                                                                 
                        </div>                     
                    </div>  {% endfor %} 
                    </div>
                    </div></section>

The git issues is to report actual issues.

Please use of of the support channels (forum, stackoverflow, discord channel) when you need help.
See "Community Forums" and "Chat Rooms" section on the sidebar of this page

Github issues really isn't the place for questions like this. Please use one of the many other avenues available instead of submitting new issues for your questions.