These forums are not for official support. If you are looking for official support please click here.

Welcome guest, please Login or Register

You are here: Home :: Forum Home :: Modules :: Hits :: Thread

   

Can’t get Top Items to appear

Rank

Total Posts: 5

Joined 2011-02-13

PM

 

I’m just installed Hits on EE v2.2.1 - Build: date 20110705 and I’m trying to display the top hit items in order on my homepage. My code looks like this:

{exp:hits:items type="entries" top="week" limit="10"}
{exp
:channel:entries channel="golf-course" fixed_order="{hits:entries}" dynamic="off"}

 
<p>{title}</p>
{/exp:channel:entries}
{
/exp:hits:items} 

No matter what I do, this simply won’t render anything…Just completely blank. I can confirm that I have the hits tracking code on the detail pages (if that even matters) and it is in fact tracking hits because there is data in the Accessory in the CP.

Thanks in advance for the help,
Adam

Rank
Rank
Rank
Rank

Total Posts: 1237

Joined 2010-12-24

PM

 

Is this the only code in your template?
If yes, could you add some text above the tags to see if the page will render something..

Rank

Total Posts: 5

Joined 2011-02-13

PM

 

I can confirm that the page will render properly if the exp:hits:items tags are not present. It will render plain text and will also display what’s in my channel:entries loop

Rank
Rank
Rank
Rank

Total Posts: 1237

Joined 2010-12-24

PM

 

But as soon as you put in the hits tag the whole page is blank?
Can you turn on PHP Error Log?

http://expressionengine.com/user_guide/cp/admin/system_admin/output_and_debugging_preferences.html
Set: Debug Preference
To: PHP/SQL error messages shown to anyone

And render the page again

Rank

Total Posts: 5

Joined 2011-02-13

PM

 

Yes, as soon as I put the hits tag in the whole page goes blank.
I turned on the PHP Error log and I still get absolutely nothing when I try to render the page.

Rank

Total Posts: 5

Joined 2011-02-13

PM

 

With template debugging on, I get this (seems to be some Hits Type Error at the end there):

TEMPLATE DEBUGGING
(0.000010 3.87MB) - Begin Template Processing -
(
0.001196 3.91MBURIsite/test
(0.001214 3.91MBPath.php Template: /
(
0.001231 3.91MBRetrieving Template
(0.001244 3.91MBParsing Template URI
(0.001900 3.91MBTemplate Group Foundsite
(0.002434 3.91MBRetrieving Template from Databasesite/test
(0.002776 3.92MBTemplate Found
(0.003207 3.92MBRetrieving Template from File
(0.006663 
4.10MB) Template Typewebpage
(0.006692 4.10MBParsing Site Variables
(0.006734 4.10MBSnippets (Keys): freelancer_version|site_id|site_label|site_short_name|last_segment
(0.006749 4.10MBSnippets (Values): FALSE|1|Fairwayflow|default_site|test
(0.006884 4.10MBParse Date Format String Constants
(0.006905 4.10MBParse Current Time Variables
(0.006949 4.10MBParsing SegmentEmbed, and Global Vars Conditionals
(0.009572 4.16MB) - Beginning Tag Processing -
(
0.009597 4.16MBParsing Tags in Template
(0.009633 4.16MBTag{exp:hits:items type="entries" top="week" limit="10"}
(0.009722 4.17MBClosing Tag Found
(0.009773 4.17MBProcessing Tags
(0.009808 4.17MBModule TagHits/items
(0.009826 4.17MBIncluding Files for Plugins and Modules
(0.012515 4.35MBFiles for Plugins and Modules All Included
(0.013227 4.36MBBeginning Final Tag Data Processing
(0.013250 4.36MBCalling Class/MethodHits/items
(0.013439 4.36MB) -> Class CalledHits
(0.016817 4.54MB) -> Method Calleditems
(0.016882 4.54MBHITSHits Type Error
(0.016958 4.54MB) -> Data Returned
(0.016994 4.54MB) - End Tag Processing -
(
0.017036 4.53MB) - End Template Processing -
(
0.017048 4.53MBParse Global Variables
(0.017996 4.54MBTemplate Parsing Finished
Memory Usage
4,763,812 bytes 
Rank
Rank
Rank
Rank

Total Posts: 1237

Joined 2010-12-24

PM

 

Can you change type=“entries” to type=“entry”

Rank

Total Posts: 5

Joined 2011-02-13

PM

 

When I change it to “entry” it does output, but it outputs the entries twice….It looks like this:

Entry 1

Entry 2

Entry 1

Entry 2

If I understand correctly how this module works, shouldn’t it just out them once in the order of MOST HITS? (i.e. the entry with more hits gets outputted first??)

Rank
Rank
Rank
Rank

Total Posts: 1237

Joined 2010-12-24

PM

 

Send you an email with a new Hits build

Let me know if it worked.