Page 1 of 1

Get HitCounter to show CGBlog images in results?

Posted: Mon Mar 30, 2015 4:50 am
by pwg
Hi,

With some help from Jo Morg, (thanks gain) I'm using Hitcounter to give me a list of the most viewed blog posts in CGBlog.
http://forum.cmsmadesimple.org/viewtopi ... =7&t=72526

I'm wondering if it is possible for the results to also include thre blog image?

I tried adding an extra key2=$entry->image to the detail template and calling this in the {HitCounter action=popular key1='CGBlog' key2={$main_image} key3=$entry->id limit="6" popular_template="test"}
but no go.

Any suggestions? Any help really appreciated.

Cheers,

Paul

Re: Get HitCounter to show CGBlog images in results?

Posted: Wed May 27, 2015 11:23 am
by nikkio
Hi!

i've made a popular template in Hitcounter like this:

Code: Select all

{foreach $popular as $linkdefn}
{capture append="ids"}
{$linkdefn->id}
{/capture}
{/foreach}
{foreach $ids as $idblog}
{CGBlog action="detail" detailtemplate="btv_popolari" articleid="{$idblog}"}
{/foreach}
hope it helps :)

.nikkio

Re: Get HitCounter to show CGBlog images in results?

Posted: Wed May 27, 2015 2:47 pm
by velden
At the time the question was asked the id property wasn't implemented yet for CGBlog.

Developer was so kind to implement it on request.
http://dev.cmsmadesimple.org/feature_request/view/10501

Why are you looping twice? Seems not very efficient, capture doesn't help either nor does the tag inside the tag (...cleid="{$idblog}"}):

Suggestion:

Code: Select all

{foreach $popular as $linkdefn}
{CGBlog action="detail" detailtemplate="btv_popolari" articleid=$linkdefn->id}
{/foreach}

Re: Get HitCounter to show CGBlog images in results?

Posted: Wed May 27, 2015 3:19 pm
by nikkio
Thank you Velden for the suggestion!
I'm new to this and I'm here to learn :)

.nikkio

Re: Get HitCounter to show CGBlog images in results?

Posted: Wed May 27, 2015 3:37 pm
by velden
nikkio wrote:Thank you Velden for the suggestion!
I'm new to this and I'm here to learn :)

.nikkio
Sure, you're welcome.