Plugin

Developer
Supported

Been There!

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Wouter Vervloet

     

You must be logged in to post.

Can’t get to work for some reason

Bug Report

JCDerrick
JCDerrick

Hi Wouter, sorry to pester you with another add-on problem, but I can’t seem to get this to work on the same site you looked at earlier.

For the entry I’m inputting this code inside the channel tag, but no matter what, I always get the same “This is the first time seeing this entry message.”

{exp:been_there entry_id=’{entry_id}’ set=‘no’}
{yes}You have already seen this entry.{/yes}{no}This is the first time seeing this entry.{/no}
{/exp:been_there}

At first I thought it might be because I do have template caching on, but even on a refresh it still doesn’t work. Can you think of anything else that might prohibit this from working for me?

Thanks,
John

Wouter Vervloet
# 1
Developer
Wouter Vervloet

Hi John,

Do you have another tag somewhere on your site where you actually add the entry to the list? The set=‘no’ parameter prevents that. set=‘no’ is only supposed to be used in listings to show whether you’ve seen it already or not.

Perhaps I should write some better documentation for it as even I had to look twice to see how it worked.

Regards,
Wouter

JCDerrick
# 2
JCDerrick

I was trying to add it to a page that listed several entries in a given order. I was hoping to use it to show which of those entries had not been viewed, alongside the ones that had been viewed. Basically I wanted a little icon to appear next to those that had not yet been viewed.

Is that possible, or am I trying to use it in the wrong way? I tried more this morning, but still wasn’t getting any results. They either all were coming back as viewed or none were coming back as viewed.

Wouter Vervloet
# 3
Developer
Wouter Vervloet

That is exactly how it is supposed to work. With one addition: you need to add a {exp:been_there} tag to the single entry page too.

// Add one of these tags to your single entry page to add it to the 'read list'
// This part is required to actually make use of this add-on

// auto discover the entry_id based on the last segment
{exp:been_there}

// or with entry_id specified
{exp:been_there entry_id='45'

Then you can use this on a listing:

<ul>
{exp:channel:entries channel='something' dynamic='no'}
  
<li><b>{title}</b{exp:been_there set='no' entry_id='{entry_id}'}{no}[NEW]{/no}{/exp:been_there}</li>
{/exp:channel:entries}
</ul

It’s the combination of the 2 that makes it all work.

Regards,
Wouter

JCDerrick
# 4
JCDerrick

Thank you for providing me an “aha!” moment. It’s working great now! Thank you for another excellent add-on.

JCDerrick
# 5
JCDerrick

Oh, one last quick question. Should this work for both logged out users as well as logged in users? Right now I can only seem to get it to work when I’m logged in to the site. Thanks.

Wouter Vervloet
# 6
Developer
Wouter Vervloet

It should work for non-members as well, as it uses cookies for that.

Though I see that the code is in dire need of a revamp… even I hink it’s a mess right now.

JCDerrick
# 7
JCDerrick

It works for me in Firefox when I’m logged in, but if I am logged out in either Chrome or IE8, I’m not getting any changes after viewing an entry. I again thought caching might be the issue, but even after I clear my cache, still nothing changes.

Weird. I guess if I have to, I’ll just show it to logged in users only.

Wouter Vervloet
# 8
Developer
Wouter Vervloet

If it isn’t working for logged out users, it is a bug. Which I’ll need to fix…