Developer
Supported
SocialCount
ExpressionEngine 2
Back to this add-on's main page
View Other Add-ons From websecret
Is it possible to sort entries via the share count
Support Request
nomoretables
|
Posted: 01 July 2013 08:54 AM |
|
|
|
Hi. Is it possible to sort entries via the share count e.g. orderby=”{exp:social_count:count url=”“}” or how would one sort entries via count? Any chance of adding facebook comment count to plugin, I would happily donate towards it.
Thanks
|
|
|
websecret
|
Posted: 01 July 2013 08:57 AM |
# 1
|
|
Developer
|
Hi
Fore example, I created new field ‘social_count’ with field_id = 7
And use this code. It count likes and write to field:
{exp:social_count:count field_id=“7” entry_id=“{entry_id}”}
And later I can sort entries with this code:
{exp:channel:entries orderby="social_count"}...
|
|
|
nomoretables
|
Posted: 01 July 2013 09:21 AM |
# 2
|
|
|
Thanks! Is field_id=“7” just a made up parameter, what is the purpose of the field id? Does your plugin count “likes” or “shares” or both in one count?
Thanks!
|
|
|
websecret
|
Posted: 01 July 2013 09:26 AM |
# 3
|
|
Developer
|
Parameter ‘field_id’ - it is field, where we write count of likes. If you need..
And plugin count likes and shares. In future I will make this option
|
|
|
nomoretables
|
Posted: 01 July 2013 09:36 AM |
# 4
|
|
|
Thanks! Facebook comment count would be great for the future too, I’m happy to donate.
|
|
|
websecret
|
Posted: 01 July 2013 10:29 AM |
# 5
|
|
Developer
|
Thank you)
|
|
|
nomoretables
|
Posted: 01 July 2013 10:35 AM |
# 6
|
|
|
Hi. I just bought your plugin. What kind of field should the new field type be, perhaps text input?
|
|
|
websecret
|
Posted: 01 July 2013 10:36 AM |
# 7
|
|
Developer
|
Yes, text input
|
|
|
nomoretables
|
Posted: 01 July 2013 10:48 AM |
# 8
|
|
|
Hi I’m using this code on the homepage of my site to show the 5 most shared articles, but it’s not returning anything? I’ve created a channel field called social_count that’s a text input.
<h4>Most Shared Articles</h4> {exp:social_count:count field_id="22" entry_id="{entry_id}"} {exp:channel:entries channel="blog" limit="5" url="http://dev.sarugbymag.co.za/blog/details/{url_title}" orderby="social_count"} {title} {/exp:channel:entries} {/exp:social_count:count}
Thanks!
|
|
|
websecret
|
Posted: 01 July 2013 10:52 AM |
# 9
|
|
Developer
|
You must use plugin inner channel:entries tag
And you have erros in channel_entries tag. Tag ‘url’ isn’t exist.
This is right code:
{exp:channel:entries channel="blog" limit="5" orderby="{social_count}"} {exp:social_count:count field_id="22" entry_id="{entry_id}" url="http://dev.sarugbymag.co.za/blog/details/{url_title}"} {title} {/exp:channel:entries} {/exp:social_count:count}
|
|
|
nomoretables
|
Posted: 01 July 2013 11:06 AM |
# 10
|
|
|
Ok thanks, but now it’s returning a result of “0”. I think it’s because of the url. I’m currently using this for the url parameter
url="http://dev.sarugbymag.co.za/blog/details/{url_title}"
but it doesn’t seem that it’s returning the
{url_title}
and I guess that’s why it’s not finding the url?
I use this
url="http://dev.sarugbymag.co.za/blog/details/{url_title}"
with all the other EE plugins and it returns the correct url. A typical url looks like this http://dev.sarugbymag.co.za/blog/details/louw-in-the-spotlight
|
|
|
nomoretables
|
Posted: 02 July 2013 03:53 PM |
# 11
|
|
|
The urls are working see this screenshot http://grab.by/o71K and at least it’s returning 5 results, but each results is still “0”. In other words I’m getting this.
Most Shared Articles
0
0
0
0
0
I had a look at the channel field data for the field social_count and for all the entries the value is “0” so I’m assuming that why it’s not working?
Thanks!
|
|
|
nomoretables
|
Posted: 02 July 2013 04:06 PM |
# 12
|
|
|
I realized it could have been because the urls are pointing to the dev site, so I tried a quick test on the live site and this time it returned numbers rather than zero’s e.g.
Most Shared Articles
9
39
35
27
0
Am I correct in saying that the first everytime th eplugin is ran, it goes through all the channel entries, looks at the share count of the urls, stores the count in the the channel field share_count and then displays 5 entries based on the count?
Thanks!
|
|
|
websecret
|
Posted: 05 July 2013 11:01 PM |
# 13
|
|
Developer
|
Show full code
|
|
|