0

I want to know if there are any modules for the following situation:

I have a content type A with reference to user 1 to user N. Now that content type A will have different status for different users let's say for user 1 it has Status1, user 2 it has Status2. First thing is how can I achieve this functionality is there any module which will be useful for this situation ?

Other part of the scenario is when user1 logs in he should see content type A with status S1 and when user2 logs in he should see content type B with status S2.

Is this possible at all in Drupal? Please suggest me.

Thanks for reading!

7
  • Are you looking something like moderation of content? – NTT Sep 28 '16 at 8:33
  • @Nagarjuna, No. I am looking for a module that will enable me to set different status of a content for different users. – parth.k Sep 28 '16 at 8:38
  • So you mean that, if u have thousands of users, you need thousand status for one node? – NTT Sep 28 '16 at 8:41
  • yes. some what like that. If you have better idea on how can I achieve this type of functionality it would be helpful. – parth.k Sep 28 '16 at 8:49
  • Group users into types and create a role and assign to the users. And then for the particular user role show the status in different way !!! – NTT Sep 28 '16 at 8:52
1

Based on chat with @parth I realised the status field belongs more to relation of book and user rather than book. Here is my recommendation in that case.

Way 1:

The easiest way I could think of is

  • have a custom table as book_inventory with columns as book_entity_id, user_id,status,record_id

In order to allow admin to a UI in place to udpate status with fields as

  • autocomplete field for book
  • autocomplete field for user
  • status could be dropdown field

this UI will let admin to set status for any book against any user down to your form UI, you can list what books are assigned to what users from your custom table with an edit link when the admin clicks the edit button the same form UI will open but prepopulated with all the fields now with help of this table you always have information user and book status with you, you can query your database and get the status runtime and in case you do not have a record agaisnt requested user and book, in that case you can have a default status, I believe 'not purchased' in your case

Way 2:

Other approach would be to try Relation module instead of entityReference, as relation module will allow fieldable relation between book and user.

1

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.