So what I want is to log the last 5 referrers per single entry (and showing them later on the single entry page)… so I started building….but I have some questions!
I am using some existing code for getting the referrers from the Functions class (log_referrer).
Buttttt I only want to log the referer for single entries, so I don’t want to call the function/hook when I am displaying more entries and limit is not 1.
What’s the best way to do this? I think it’s best to use the weblog_entries_tagdata_end hook, and check if a second segment exists (url title).
Anyone can confirm this or tell me a better way to do it?
thanks!
Personally, I think a module would be a better suited solution for this type of functionality.
Create a method that does the logging. Place the tag into the {exp:weblog:entries}-pair of your single-entry-template passing the {entry_id} as a parameter.
And another method to display the results.
If you intend to put the display-tag into all (and only) your single-entry-pages, you could even combine the logging and displaying into one single method.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.