1

I've got an Intranet with a list of job postings (each of which are channel entries), and I need to give each logged-in user the ability to click a button to hide an individual entry from their listings.

Each user has their own user profile channel entry (I'm using Profile:Edit for this), so I imagine that adding a custom field to their profile named 'My Hidden Entries' is the way to go. I'm thinking that a field which saves entry ID's in a pipe-separated list would be good, as it'd mean I can use them in a channel entries tag to hide their hidden entries (entry_id="not {cf_user_hidden_entries}"), as well as being able to use the opposite method to generate a list of entries a user has hidden (entry_id="{cf_user_hidden_entries}").

My question is, does this approach sound good? And if so, what fieldtype would you recommend to use that would save entry ID's in a custom field in this format, and allow me to easily add/remove entries from their list? It's the adding and removing of entries that I'm particularly concerned about, as this will be done outside the CP.

4

To be honest, I would suggest using an addon like 'LikEE' which allows you to toggle an entry in some way. Obviously the natural suggestion is for 'liking' entries - however, you could use it whereby, you list the jobs and when a user 'likes' it - it's the indication to remove it.

Then inside your exp channel loop - simply do something like the following:

{exp:channel:entries .... }
    {exp:likee entry_id="{entry_id}"}
      {if "{like}"}
       // They've liked it, so don't do anything
      {if:else}
      // Put your job logic here
      {/if}
    {/exp:likee}
{/exp:channel:entries}

You might need to fiddle with the syntax - however, this would potentially be an easy way of doing it without messing with posting entries and channel updates etc.

| improve this answer | |
  • 1
    This add-on allows you to "Like" or "Dislike" something. So you could use the "Like" for its actual purpose and then use "Dislike" as a basis to hide entries. booyant.com/likee/getting-started – Lea Hayes Dec 13 '12 at 1:32
  • 1
    Thanks for this. I like the idea and think this is a much nicer way to go. :) – Stephen Dec 13 '12 at 2:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.