reizinixc/blogattachment

File attachment plugin for RainLab blog module

v1.0.0 2014-11-09 03:02 UTC

This package is not auto-updated.

Last update: 2024-12-17 04:29:20 UTC


README

This plugin extends the RainLab Blog plugin with file attachment features.

Plugin dependency

This plugin wants you to install RainLab Blog plugin first.

How to install

composer require reizinixc/blogattachment && echo /plugins/reizinixc/blogattachment >> .gitignore

How to use

After install this plugin, you will see the "Attachments" option in "Manage" tab.

How to attach files

If you can upload featured images, you can upload files by click the plus icon and choose the files.

How to get attached files

When you retrieve the blog post. You can get all attached files by attachments attribute e.g. posts.attachments and get attached files by iterating through attachments or use an array index.

Here are some accessible fields of attachment object.

Example usage

{% for attachment in post.attachments %}
    <a href="{{ attachment.path }}">{{ attachment.file_name }} ({{ attachment.file_size }}B)</a>
{% endfor %}

Found bugs/Translation/Enhancement

I will salute you if you create an issue or a pull request. Please feel free to do it :)

License

MIT