← Back to BlogTags with AJAX Support
Hi Surhaman,
thanks for this plugin! I was wandering how to correctly set the plugin to work with rainlab blog. We have a project and yet configured rainla blog correctly.
So we have a news page and news/Category to render the blog categories list and news/NewsPost to render the single post page. All routed correctly to work
Now in the single post page i inserted both {% component 'tags' %}{% component 'relatedPosts' %} but i have this error:
[code]"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) desc limit 5' at line 4 (SQL: select from rainlab_blog_posts
where published
is not null and published
= 1 and published_at
is not null and published_at
< 2016-07-18 10:34:27 and id
<> 3 and (select count() from rahman_blogtags_tags
inner join rahman_blogtags_posts_tags
on rahman_blogtags_tags
.id
= rahman_blogtags_posts_tags
.tag_id
where rahman_blogtags_posts_tags
.post_id
= rainlab_blog_posts
.id
and 0 = 1) >= 1 order by ( select count(*) from rahman_blogtags_posts_tags
where rahman_blogtags_posts_tags
.post_id
= rainlab_blog_posts
.id
and rahman_blogtags_posts_tags
.tag_id
in ()) desc limit 5)"
[/code]
Why?
I shoud first create the tag page to render the single tag?
And in the list of tags how can i create linked tags to redirect to single page as keios did here https://blog.keios.eu/ with tags cloud?
Thanks bye!
Last updated
Hi Gabtram,
Thanks for using my plugin and report that. I guess you didn't add any tag to your blog post before. But, it should fixed in the latest version (BlogTags v.1.0.7).
For second question, you can combine tags component
and searchPosts component
to do that. Here's my simple code,
tags.htm
title = "tags"
url = "/tags"
layout = "default"
is_hidden = 0
[tags]
results = 0
sortOrder = "created_at desc"
==
{% set tags = tags.tags %}
<ul>
{% for tag in tags %}
<li><a href="{{ 'tag'|page({ slug: tag.slug }) }}">{{ tag.name }}</a></li>
{% endfor %}
</ul>
tag.htm
title = "tag"
url = "/tag/:slug/:page"
is_hidden = 0
[searchPosts]
slug = "{{ :slug }}"
pageNumber = "{{ :page }}"
postsPerPage = 10
postPage = "post"
sortOrder = "published_at desc"
==
{% component 'searchPosts' %}
Last updated
1-2 of 2