#92

Product support

Get help in the plugin support forum.

Categories

  • Miscellaneous
  • Utility

This plugin allows end users to add tags in Rainlab Blog plugin with ease.

Features:

  • Add tags with AJAX
  • Display the most related posts by tags
  • Display lists of tag
  • Display posts with the associated tag (Pagination support)
  • and many more...

Like this plugin?

If you like this plugin, please give this plugin good review in reviews section and tell your friends :) But if you don't like it, please tell me and I will improve it for you. Or you can appreciate me by make a donation with PayPal.

Credits

I want to say thank you for Scott Bedard for my inspiring plugin.

Add tag with AJAX

This plugin have three components.

Related posts component

Use relatedPosts component to display the most related posts by tags. The component has the the following properties:

  • Post slug - the value used for looking up the post by its slug. The default value is {{ :slug }} to obtain the value from the route parameter :slug.
  • Results - how many related posts to display. The default value is 5.

Here's the basic component usage on the ppst page:

title = "post"
url = "/post/:slug"

[blogPost]
slug = "{{ :slug }}"

[relatedPosts]
slug = "{{ :slug }}"
results = 5
==
<h1>{{ post.title }}</h1>
<p>
    <i class="glyphicon glyphicon-tags"></i>
    {% for tag in post.tags %}
    {{ tag.name }} {% if not loop.last %}, {% endif %}
    {% endfor %}
</p>
<p>{{ post.content_html|raw }}</p>

<h3>Related articles:</h3>

{% component 'relatedPosts' %}

You can see at the above there is blogPost component. It's the component from Rainlab Blog plugin to display single post in page.

Search posts component

Use searchPosts component to display posts with associated tag. The component has the the following properties:

  • Tag slug - the value used for looking up the tag by its slug. The default value is {{ :slug }} to obtain the value from the route parameter :slug.
  • pageNumber - this value is used to determine what page the user is on, it should be a routing parameter for the default markup. The default value is {{ :page }} to obtain the value from the route parameter :page.
  • postPage - path to the post details page. The default value is blog/post - it matches the pages/blog/post.htm file in the theme directory. This property is used in the default component partial for creating links to the blog posts.
  • postOrder - the column name and direction used for the sort order of the posts. The default value is published_at desc.

Here's the basic component usage on the tag page:

title = "tag"
url = "/tag/:slug/:page?"

[searchPosts]
slug = "{{ :slug }}"
pageNumber = "{{ :page }}"
postsPerPage = 2
postPage = "post"
sortOrder = "published_at desc"
==
{% component 'searchPosts' %}

Tags list component

Use tagList component to display lists of tags. The component has the the following properties:

  • Results - how many tags to display. The default value is 0. Which mean display all tags.
  • Tag order - the column name and direction used for the sort order of the tags. The default value is created_at desc.
  • Display empty tag - Display tag although doesn't have any posts.

Here's the basic component usage on the tags page:

title = "Tags"
url = "/tags"

[tags]
results = 0
sortOrder = "created_at desc"
==
{% component 'tags' %}

The examples above are coded in the default component partial plugins/rahman/blogtags/components/*/default.htm. If the default markup is not suitable for your website, feel free to copy it from the default partial and replace the {% component %} call in the examples above with the partial contents. You can give me a question for best practice in the support section.

1.0.9

Update tag field using taglist (Please update your CMS core)

Jan 14, 2017

1.0.8

Improve to load tags in component init (Thanks to Vojta Svoboda)

Oct 22, 2016

1.0.7

Fix error if there is no associated tag to blog post

Jul 21, 2016

1.0.6

Fix don't load tagbox when export/import

Apr 13, 2016

1.0.5

Fix can't load tag list if installed OctoberCMS in subdirectory

Apr 12, 2016

1.0.4

Fix can't uninstall the plugin

Apr 03, 2016

1.0.3

Improve styling

Mar 30, 2016

1.0.2

create tags table

Jan 01, 2016

1.0.1

First version of BlogTags

Jan 01, 2016