0

For an event ticket system I have created a node type with multiple date fields including start- and end-dates.

-EVENT1-
Date A
Date B - Date F
Date G

- Event2 -
Date B
Date C
Date E - Date G

Now I need to add a boolean field to every date that is inserted into an event node to possible mark it as 'sold out event day'. How is this possible when I want to use the start-/end-date option? I don't want to create a nodetype 'date' and then reference its nodes to an event-node... Thnx!

  • Given this requirement, I don't think your data model is correct. I think you should consider having separate event and event occurrence content types, with the occurrence type having an entity reference to the event. The you can flag a particular occurrence as being sold out. – Alfred Armstrong Apr 11 '13 at 12:48
  • Maybe I can use some kind of automatic entity construction rules solution where the saving/changing of an event node creates a event-date-entity that I then can process on its own...? – headkit Apr 11 '13 at 16:24
  • @AlfredArmstrong Yes, thank you. But what I want to prevent is that the user needs to create one entity for each event when the event days are in one periode/week or so... – headkit Apr 11 '13 at 16:26
  • I guess you'll need something like your event-date entity to manage availability. This is a complex requirement to be doing from scratch, though: have you looked at what others have done? I think agreservations.com might be worth taking a look at for a start. – Alfred Armstrong Apr 11 '13 at 16:48
  • Yes, found that, too. But this is a bit too heavy. Could be a good solution but I don't want to build a whole shop system. Too much work that no one will pay... – headkit Apr 12 '13 at 10:43
1

In the database (the appropriate table for your date field), you have a column called 'delta' wihch start from 0

In your example Date A (delta = 0) Date B - Date F (delta = 1) Date G (delta = 2)

Your probably can add an hidden (for non-admin user) field in your node type (for example an textfield serialized array) to store the boolean value for each delta. This can be done programmaticly with rule an php algorithm on each node_save. In view you can also get the delta value

  • Interesting. But I think I have to auto-generate some entities because for dates with start-/end-enries I need more than one delta/database-value to differentiate every single date. – headkit Apr 11 '13 at 12:50

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.