3

User profile is organizer of this year boat show. After registering, user can create basic pages with main photo and basic text. Afterwards, user is given another role through rules, so he can not by accident create more basic pages but can still setup images, dates, videos, announcements, which are all visible as different views contextual blocks on basic page of the user.

All is fine, except i have no idea how to setup same thing for next year? User can edit basic page, but i would rather leave past year (basic page with views blocks) somehow be archived and visible on the website and his profile, and give him option to setup data for next year.

1
  • What access modules do you have, if any? Nodeaccess can do most of what you need I think. Commented May 21, 2016 at 2:09

1 Answer 1

2

Option 1 - Add a field to reflect the year

If you'd add a (select list) field to indicate the year that the basic page relate to, you could use the value of that field with some Rules conditions to perform all sorts of validations to prevent a user creating and/or updating pages for any years you do not want to allow.

The Rules Event would probably be "Before saving content". And the Rules Conditions would simply be (a) "Entity has field" (for this extra field) and (b) "data comparison" (to find out which year the basic page is about).

Option 2 - Use the Group module

You could use the Group module for this. Group allows for creating arbitrary collections of your content and users on your site, and grant access control permissions on those collections. The Group module creates groups as entities, making them fully fieldable, extensible and exportable.

So to answer this question, you'd create a group for each year. For more details about the various roles and permissions, refer to my answer to "What are the various roles supported by the Group module?".

Resources:

PS: Group is available as of D7, and has a D8 version also.

1
  • Thanks Pierre. In meantime i have setup taxonomy terms with this and following 5 years, so user has to choose on each content type which year it belongs to. It is autoset to this year so they do not have to change anything, and if they choose wrong year they will figure it out sooner or later after checking the content. I was thinking about gruop module, but might be to much for this.
    – Azz Kawa
    Commented May 21, 2016 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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