I have a website that has a give away of tickets for shows. Some times I have 2 tickets to give, sometimes 20... So I wanted to know how to dynamically change the "items to display" accordingly to somewhere else but not that static number that I put when I create the view. Because when I do the shuffle, it displays EVERYBODY that submitted and I have to manually count according to the num. of tickets I got. It can be a programmatically change or a module. enter image description here

edit: I wasn't very clear, I didn't express myself well. Ppl go to my website and submit to giveaways of tickets. I just want to show a list of winners for the tickets according to the numbers of tickets I have, so it displays only the winners. Right now, it displays everybody that submitted (after a shuffle because the list is in alphabetic order) for the giveaway because I can't change the "Items to display", so when people go see who won, the page show a giant list. I cant create a view for every giveaway cause I have plenty per week and it would be so much work. Basically what I want: 3 tickets -> a list with 3 items(winners), 4 tickets -> a list with 4 items(winners). Sorry for those who tried to answer, I'm new to all this stack overflow thing.

  • I'm guessing the dislikes are trying to feedback your question isn't clear (I haven't disliked myself) and you're probably trying to solve the wrong problem. You're being specific about which answer you want, without giving enough information to solve it. What is your views display actually listing? Events, tickets, users who applied to get a ticket? You have to include more info in your Views structure and probably your CTs as well so it's clear what the problem and the goal are. – prkos Nov 26 '18 at 21:32
  • thanks, prkos. I did an edit and tried to give more efficient information. – Bruno Capriglioni Nov 27 '18 at 12:40
  • You don't have to create a separate View for each giveaway. There are Contextual filters you can set up that automatically create different output based on conditions, for example list winners of only the giveaway that you're currently viewing. There is still some info missing: how do you mark who the winners are? Through an EntityReference field from Giveaway ContentType to users? Where do you want to show your winners list? On each Giveaway page? Or some independent page that lists all winners but groups by Giveaway? Or something third? The solution depends on the details and your goal. – prkos Nov 27 '18 at 17:10
  • I don't want you guys to solve the major problem for me. I just want to know if there is or not a way to change the "items to display" based on a database or whatever to solve a bigger issue which I can't explain with words. Anyway, thank you again for your concern. The fault is mine, tried to specify too much. – Bruno Capriglioni Nov 27 '18 at 19:08

Just disable paging and do "show all items". This will show all results without a pager. As for other results being mixed in (shuffle?) that can be solved by adding better filters or contextual argument filters to modify the query to just the tickets you want to show.

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.