Giter Club home page Giter Club logo

featured-images's Introduction

featured-images

Adds a field to upload image to Rainlab Blog Category

Install the RainLab.Pages plugin

 First you have to make sure you have added the RainLab.Pages plugin to your project.
 Then add the J000.Featuredimages plugin.
 Now you'll find a file field when you add or edit a static page.

OLD INFO BELOW!

How to use it in a blog post or category page

To view your featured images you find them by adding .featured_images to your category-object, just like you would on your featured_images. As an example:

{% for category in post.categories %} {# loop blog post.categories #}
    {% if category.featured_images.count %} {# check to see if your category have any images #}
        {% for image in category.featured_images %} {# loop category.featured_images display images #}
            <img src="{{ image.path }}" alt="{{ image.file_name }}" />
        {% endfor %}
    {% endif %}
{% endfor %}

That's all, folks!

featured-images's People

Contributors

j000 avatar ribsousa avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.