Jump to content

How do I reuse certain page with data repeatedly but with adding extra data each time and storing it as a unique page?


Vineet Sawant
 Share

Recommended Posts

Hello,

For the ticket booking site that I'm working on, I've made seat chart for each theatre.

Each seat chart is made using a repeater field called seat_row which has row name, left, center & right columns(they use rangeslider for storing the number of seats. eg, left column might have 1-7 seats, center column will have 8-16seats and right column will have 17-25seats.).

For every show, each row has different ticket cost. What I want to do is, whenever I add a new show for any drama, the page will get theatre name using a pagefield. This way, I'm linking the seat chart associated with theatre to the show.

(If it matters, note that theatre gets it's seat chart using a pagefield which links to children of page "maps" where each child page is a map for a theatre.)

Now, that I've got the seat chart for the show, I need to add another column to the seat_row repeater field, called row_cost which will store the ticket cost for that row, for that particular show.

I guess, cloning the seat map for each show can be a solution. I'd like to know if this is a right solution or if there's any other simpler way.

Thank you all in advance.

Edited by Vineet Sawant
Link to comment
Share on other sites

Does each row have a different cost, or is each row completely independent in terms of cost? If there is some redundant data here, it might make sense to associate rows to cost-categories separately. I'm also not sure that a repeater is ideal here, because doesn't that prevent you from re-using the same seat chart for other shows? I like repeaters for some specific things, but never for anything that can be re-used as references among other pages. 

  • Like 1
Link to comment
Share on other sites

Hello Ryan,

Thanks for your reply.

Does each row have a different cost, or is each row completely independent in terms of cost? 

Yes each row has different cost for every show.

 I'm also not sure that a repeater is ideal here, because doesn't that prevent you from re-using the same seat chart for other shows? 

Umm, yes that's the actual problem. Every theatre has a seat chart made of repeater fields. To make seat map easily and to generate using system I used repeater field.

In an ideal case, every show should have it's own seat chart. This seat chart should be same as that of the theatre the show will be playing in. I still don't know how it can be done so I used the repeater fields to make seat chart for each theatre. Now I'm thinking probably cloning can help.

I'd love to know what you can suggest.

Thanks again Ryan :)

Link to comment
Share on other sites

Most likely repeaters aren't what you want. You can create any structure with pages so that opens up your options, even if it makes input less convenient. But for specific needs like this, you can us the API to automate any input challenges. You could also make a spreadsheet that contains your data and use the ImportPagesCSV module to import them (or your own import script). Another option is to create your own SeatingChart Fieldtype an Inputfield. Fieldtypes are designed to represent potentially very complex data, and are the most efficient way to create a reusable complex data type. But creating a Fieldtype does require getting into database schema and more PHP than usual site development. 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...