valquire Posted March 14, 2022 Share Posted March 14, 2022 Hi community, to be honest this may be very simple, I just don't know where and what to look for: I want to create a list of dates and titles from the backend, in this case to manage a list of upcoming concerts (date, title, desc, link, ticket link). This should be listed on the website one after the other (date order, maybe auto archival later) and editable in the backend (delete e.g. if concert isnt happening or postponed etc). Maybe you can guide me to the general functionality to look for in the manuals or modules? Just a hint.. Thanks a lot in advance! Link to comment Share on other sites More sharing options...
virtualgadjo Posted March 14, 2022 Share Posted March 14, 2022 Hi, well, pw speaking, this is the simplest thing you can imagine ? actually, you won't need any module to realize what you describe, just page(s) and fields remember the pw way of thinking, everything is a page, so, just create a page upcoming dates which will have as many subpages you want, every subpage containing all the fields you need, date, title, description, tags, and so on, done you could even do the same thing with a simple page and a repeater field, each repeater element containing all those fields too, the only thing to keep in mind is the number of elements you'll need, if there is really a lot, maybe it will be faster to edit with subpage than with a repeater, if you're thinking about 20/50 upcoming dates, go for a repeater, everything will be in the upcoming dates page once you'll have done it, you won't believe how easy it was with pw ? have a nice day Link to comment Share on other sites More sharing options...
rick Posted March 14, 2022 Share Posted March 14, 2022 Hello @valquireand welcome to the forums! It sounds like you are looking for an event calendar. You can take a look here at a pro module, or search for other event calendar topics. If you prefer a simpler solution, then you can create a page for each concert to display on the front-end. Link to comment Share on other sites More sharing options...
Stefanowitsch Posted March 14, 2022 Share Posted March 14, 2022 This would be a perfect use for a repeater field. https://processwire.com/docs/fields/repeaters/ You would create repeater field called "concerts" within the backend. Then you create the subfields for the repeater to be added. Like Date, title, desc, link, etc. Those fields can then be added inside the settings of the repeater field. Add this repeater field to one of your templates and you can add concerts. To render the field in the frontend use it like this: <? foreach ($page->repeater_concerts as $concert) { ?> <ul> <li><?= $concert->date ?>/li> <li><?= $concert->title ?></li> <li><?= $concert->desc ?></li> </ul> <? } ?> Link to comment Share on other sites More sharing options...
horst Posted March 14, 2022 Share Posted March 14, 2022 (edited) Hi, it is a choice of personal preferences, definetly! ? I would go with a parent page and sub pages. The parent page gets a template called concerts (NOTE the plural s at the end). The settings for that template includes a single page usage and a family setting like allowed parent is, for example, "home". And allowed sub templates are the yet non existent "concert" (NOTE: singular!) The sub pages get the template concert (NOTE singular), without count limitation, but family settings restricted to allowed parent(s) = concerts. (Children for concert are not allowed) The concert template gets all your fields: date, title, desc, link, ticket link This way it is faster in backend then opening a single page with hundred(s) of repeaters. More advantages can be better SEO URLs for each single concert, (think permalinks), or at least the native match of page tree and public URLs, without any abstraction layers like URL-Segments etc. Also a later implemented archiving is easier to realize with sub pages then with repeaters. But, as said above in this post and by @virtualgadjo, it depends A) on the number of concerts you will handle and B) on personal preferences. ? In your concerts template file, you can iterate over all sub pages with every filter and sorting selector you like: // $page is the single (parent) page with template concerts ! <?php foreach($page->children() as $concert) { ?> <ul> <li><?= $concert->date ?>/li> <li><?= $concert->title ?></li> <li><?= $concert->desc ?></li> </ul> <?php } ?> // optional selector is easily possible, e.g. show only current and future concerts <?php foreach($page->children("date>=today, sort=-date") as $concert) { ?> ... Edited March 14, 2022 by horst added colors 2 Link to comment Share on other sites More sharing options...
valquire Posted March 14, 2022 Author Share Posted March 14, 2022 11 hours ago, virtualgadjo said: Hi, well, pw speaking, this is the simplest thing you can imagine ? actually, you won't need any module to realize what you describe, just page(s) and fields remember the pw way of thinking, everything is a page, so, just create a page upcoming dates which will have as many subpages you want, every subpage containing all the fields you need, date, title, description, tags, and so on, done you could even do the same thing with a simple page and a repeater field, each repeater element containing all those fields too, the only thing to keep in mind is the number of elements you'll need, if there is really a lot, maybe it will be faster to edit with subpage than with a repeater, if you're thinking about 20/50 upcoming dates, go for a repeater, everything will be in the upcoming dates page once you'll have done it, you won't believe how easy it was with pw ? have a nice day this is awesome and how i then imagined to do it! and yes, i love the pw way! i knew it is done a smart way. thanks! Link to comment Share on other sites More sharing options...
valquire Posted March 14, 2022 Author Share Posted March 14, 2022 hey everybody, you are all super awesome! thanks for the help and directions. i thought about the same processes but couldnt find a hook to start digging. now i got plenty of material from you all, thanks a lot!! 1 Link to comment Share on other sites More sharing options...
valquire Posted March 14, 2022 Author Share Posted March 14, 2022 11 hours ago, Stefanowitsch said: This would be a perfect use for a repeater field. https://processwire.com/docs/fields/repeaters/ You would create repeater field called "concerts" within the backend. Then you create the subfields for the repeater to be added. Like Date, title, desc, link, etc. Those fields can then be added inside the settings of the repeater field. Add this repeater field to one of your templates and you can add concerts. To render the field in the frontend use it like this: <? foreach ($page->repeater_concerts as $concert) { ?> <ul> <li><?= $concert->date ?>/li> <li><?= $concert->title ?></li> <li><?= $concert->desc ?></li> </ul> <? } ?> this is what i was looking for in the very beginning, thanks for pointing me to the right direction! 1 Link to comment Share on other sites More sharing options...
aagd Posted March 14, 2022 Share Posted March 14, 2022 I used Ryans table field for a similar listing. It's a pro module (not free), but I liked the easier, faster entry of dates and the better overview. It's like a leaner version of a repeater field, good for hundreds of entries. https://processwire.com/store/pro-fields/table/ Link to comment Share on other sites More sharing options...
Stefanowitsch Posted March 14, 2022 Share Posted March 14, 2022 43 minutes ago, aagd said: I used Ryans table field for a similar listing. It's a pro module (not free), but I liked the easier, faster entry of dates and the better overview. It's like a leaner version of a repeater field, good for hundreds of entries. https://processwire.com/store/pro-fields/table/ Pro Fields Table is actually already included in the PW core. It is the only Pro Fields module that is free to use. You just have to install it from the modules list in the PW backend. Link to comment Share on other sites More sharing options...
3fingers Posted March 15, 2022 Share Posted March 15, 2022 12 hours ago, Stefanowitsch said: Pro Fields Table is actually already included in the PW core. It is the only Pro Fields module that is free to use. You just have to install it from the modules list in the PW backend. Actually is not. PageTable (which is in the core but disabled by default) is not the same as Pro Field Table :) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now