Jump to content

Search the Community

Showing results for tags 'repeater'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Hi there! The title may be a bit misleading, or at least it's how I tried to achieve something which may not be possible in that combination. But let's start from the beginning: I'm trying to create a football team & game manager with processwire. As someone who used Excel in all ways possible to manage every aspect of a football team (members, positions, games, etc.) and having used processwire for solely building websites in the past, I thought this has to work, too. And for the most part it does! Yet, I have a few things which may work even better and that's where I'm stuck. I currently manage: Team members (pages) Game positions (pages) Games (pages) In "games" I have something like "location", "opponent", etc. and I have created a repeater field which includes "team member" (selector from page "team members") and "game position" (selector from "game positions"). I am able to map a "position" to a "team member" for each game. That's fine & well, BUT: it would nice, to have those selector being somehow connected to each other in a way, that if I am selecting a team member and assign him to a position, that this position & member will be deleted from other repeater "selectors". This way I want to prevent a team member or game position to be used n-times in one game. It's just a usability thing, but a big one for me, since I may be not the person working with this in the future. Is this somehow possible? Thank you!
  2. Hello. I'm developing website for restaurant network, and I use repeater field for menu (meals). Page has repeater field, named "menu". It has 2 fields - title (multilingual - 3 languages) and price. 150 repeater entries are created and save normally. Starting from 151 when I fill new repeater row and click save, PW shows success message but 151st row isn't saved. How can I fix this problem? Or can you suggest any alternative method for storing such data? Using page for each row is very hard for editing. Thank you in advance! I forgot to notice one thing, when I use debug tools I see that the data from 151st is passed in POST array.
  3. First of all, I would like to thank you all for such great documentation and community. I have just started developing 5 days ago and I have completed some really difficult programming relatively easily. But, I do have a quick question. The site I am developing has an events listing that links to events that have a possibility of multiple dates. That was easy. But, now I have to create the schedule listing and the events could look like this: Monday, Nov. 3rd 10:00 am - Event 1 11:30 am - Event 2 Tuesday, Nov. 4th 12:00 am - Event 1 So, to achieve this, I create a repeater field for the event date and time. I created the functionality for the schedule and have the events sorted by date but if the event has multiple dates and times, I cannot figure out how to pull the second date and time out and then list the event again. I thought about doing a recursive function that traverses the page array and pull out each event and date/time, putting it into a new array, sorting it and then doing the schedule. But that just seems like overkill and I am little rusty with my PHP. Does someone have something like this or do I need to rethink this?
  4. Hello, I have problems with repeaters. I tried to delete or modify an item from a repeater. But when the page reloads, it appears again. I was also trying to add a new article having the same result. Can anyone help me? Please
  5. Hi, I'm doing something wrong here: I have following structure for an event page that allows for multiple additional dates if neccesary and i want to display all for this year: EVENT - event_begin - event_end - daterepeater -- daterepeater.event_begin -- daterepeater.event_end $thisyr=date(Y); $nxtyr=date(Y)+1; $aftnxtyr=date(Y)+2; echo "<h1>{$page->title}</h1>"; echo $thisyr; foreach($pages->find("event_ende|event_daterepeater.event_ende>=01/01/$thisyr,event_beginn|event_daterepeater.event_beginn<01/01/$nxtyr") as $s) { echo "<li><a href='{$s->url}'>{$s->title}</a>, {$s->event_beginn} - {$s->event_ende} | {$pages->get("$s->event_location")->title}</li>"; } Basically it works. The event page is found but the output happens only once and not for every matching entry in the repeater. Do i need a nested loop to output those (i might need it anyway to output the repeater dates but i'm still struggling with the find )?. thanks
  6. Hi, I have a simple content structure like this: - A page -- title -- content (repeater field) --- headline --- body --- images (image field) -- (…) - Another page (...) Is it possible to not only upload images via the "image" field, but let it select already uploaded images (in other "content" repeaters or on other pages)? (Kind of how the image thing inside the wysiwyg works - I don't want to have the image selection inside the "body" field and disabled the image option in the wysiwyg editior setting). Or do I need to introduce a new field alongside the regular mage field? The actual scenario is like this: With the above structure, the editor created three content sections on one page a, b, c. In each section, he uploaded one image. After a whle he decided that the section c is in fact part of section b, and deletes it, after appending it's "body" content to section b's body field. Because now the text of section c is in section b, he also wants to have section c's image go along with section b and the image there - but the image field seems to only offer a new upload of the image - or am I missing something? thanks, Tom
  7. I've stumbled upon a weird issue with repeaters. I've created a repeaterfield with only a title field and assigned it to a template. When I create the first page everything goes well, but then when I'm creating additional pages I'm getting this error: ProcessPageAdd: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'for-page-23947-23799' for key 'name_parent_id' I'm not getting redirected (probably because of the error, but the page does get created with the RepeaterField correctly). The problem seems to exist in the file FieldtypeRepeater.module in the function 'getRepeaterPageParent'. I've modified the file to see what actually happens and it looks like the function doesn't find the required page of saves the page correctly. protected function getRepeaterPageParent(Page $page, Field $field) { $repeaterParent = $this->getRepeaterParent($field); $parent = $repeaterParent->child('name=' . self::repeaterPageNamePrefix . $page->id . ', include=all'); $this->message("L".__LINE__." | selectorresult: ".$parent->id); if($parent->id) return $parent; $parent = new Page(); $parent->template = $repeaterParent->template; $this->message("L".__LINE__." | template: ".$repeaterParent->template); $this->message("L".__LINE__." | parent: ".$repeaterParent->path); $parent->parent = $repeaterParent->id; $parent->name = self::repeaterPageNamePrefix . $page->id; $parent->title = $page->name; $parent->addStatus(Page::statusSystem); // exit early if a field is in the process of being deleted // so that a repeater page parent doesn't get automatically re-created if($this->deletePageField === $field->parent_id){ return $parent; } $parent->save(); $this->message("L".__LINE__." | looking for: ".self::repeaterPageNamePrefix . $page->id); $this->message("L".__LINE__." | current for: ".$parent->name); $this->message("L".__LINE__." | Created Repeater Page Parent: NAME={$parent->name} a " . $parent->path, Notice::debug); return $parent; } See the attachment for the output. IMO the second time FieldtypeRepeater: L574 | should output the previously created page... Anyone has an idea what's going wrong? I'm on the latest master branch.
  8. Hi everone. I've searched the forum to find a solution to my problem, but so far nothing did the trick for me. So here's the issue: I've created a repeater called "news" and it's used on several overview pages (working perfectly). Now, on the home page, I want to show the latest 10 news, and I figured you can do this like this: <? foreach($pages->find("template=repeater_news, sort=-modified, limit=10") as $news): ?> <li><a href="<?php echo $news->getForpage()->url ?>"><img src="<?php echo $news->getForpage()->icon->url ?>"><span><?php echo $news->text_primary ?></span><br><?php echo $news->getForpage()->title ?> - <?php echo date('d/m/Y g:i a', $news->modified) ?></a></li> <? endforeach; ?> That works fine on my localhost, but as soon as I access the page via IP (like externally), the list stays empty. The same problem happens on my search page (when searching news). "Normal" pages don't seem to have the problem. Can anybody help me? Cheers and thanks
  9. On this topic: I've asked (and answered myself) how to get the field name on a page used for uploading files. Now, what if I'm using a repeater field to upload files? How can I get the name of the page of the item uploaded to? I'm using a InputfieldFile::fileAdded hook and even if I try to get the $event->arguments(0)->page->name I get the internal name of the repeater page, not the name of the page where the field is. $event->arguments(0)->page->parent->name is almost what I need because I get the name "for-page-xxxx" and xxxx is the id of the page where the field belongs. Is there any easier way to reference this page name without, I don't know, parse this string to extract the numeric id and then search for the page name?
  10. Hey guys, I struggled about half a week, okay wasn´t the only thing I´m on..but I´m not getting it. I´m working on a little page with a little shop, just a few books. Of course I know Apeisas shop, but it doesn´t support tax out of the box right now and I want to have the whole shop with cart and checkout on a single page and I had half of it already working with jquery but wanted to have something more scalable. While trying to get it on my own I´m digging more into php and PW Blabla I have a template called order. My plan is to store the cart in order page like "Cart 12.5.2014" and name it to "Order 12.5.2014" when checkout is completed. The choosen cart items are stored in a repeater "order_items" with fields "order_qty" and "order_product" (page fieldtype) Everything works fine. First time the customer is adding an item to the cart the system will create the page and add the product to the repeater. I´m storing an individual id in the session which will be the name (path) of the page so I can check if one is already existing and just add more items to it. Once the customer is ready and fills out the order form, the page gets updated his name and stores the address information and the id in the session gets deleted so the order is kind of locked. The only problem is, I´m not able to update the item list properly. Either each time the customer adds item 1 to the cart it creates a new repeater or it changes only the qty of the first and only repeater even when he adds another item to the cart Because I´m not a 100% sure what I´m doing it´s more like trial and error. This is my last working code where it´s updating the same repeater item every time if($input->post->addtocart) { $sid = $session->sid; $order = $pages->get("name=$sid"); $order_items = $pages->get("name=$sid")->order_items; if(!$sid) { $order = new Page(); $order->parent = $pages->get("/bestellung/"); $order->template = 'order'; $order->title = 'Warenkorb '.date("d.m.Y - G:i:s"); $session->set('sid', str_shuffle(session_id())); //str_shuffle to prevent problems when customer finishes an order and want to make another order $order->name = $session->sid; $order->save; } if(count($order_items)) { foreach($order_items as $items) { if($items->order_product = $form_addtocart[item]) { $items->of(false); $items->order_qty += $form_addtocart[qty]; $items->save(); break; } } } else { $order->of(false); $order_items = $order->order_items->getNew(); $order_items->order_qty = $form_addtocart[qty]; $order_items->order_product = $form_addtocart[item]; $order_items->save(); $order->save(); } } // end addtocart On the one hand, I´m understanding what happens. On the other I have no idea what´s going on. Maybe there are a lot of improvement possibilities on my code haha. Uh, I thought about customizing the events fieldtype to store the items, but I thought repeaters are easier for the beginning. Maybe tailored events field will be the next version of the shop. I really hope there is an easy solution for this "little" thing. Maybe I missed the right search terms. Cheers and a nice evening to all EDIT: Forgot to mention, that I know, that the "if(count($order_items))" is not a good way, because once there is an item in the cart it´s true And I already tried in_array() and array_search() but couldn´t get it working :-/
  11. I'm just getting used to using repeaters in pages (yeah, I'm slow) but haven't been able to find out if they can be used as part of the InputfieldWrapper returned by getModuleConfigInputfields() for configurable modules. I suspect they can't but would be happy if I were wrong. Can anyone give a definitive answer?
  12. Hey, I started on my tag system with repeaters... It works, but I get a bunch of errors... And I've got no idea what the problem is. These are errors in the session->error and I've put them in a JQuery plugin called toastr. It looks like this: What can I do to change this? Or is this only in debug mode and it doesn't really matter?
  13. Is there a way to limit the repeater entry on the admin? for example, user can only enter a max of 10 entries
  14. I have a field called "number of columns" its an integer (the max is 5, just a note in the description) If it is set to >0 then it shows a repeater (this is working) The repeater then has 5 textfields, and each one needs to only show up if the number of columns requires it so for example, if somone puts in "2" then the repeater shows up (this works as I mentioned) and the repeater should only show 2 of the textfields (this is the part that isnt working). I've went in and set col1_text to be visible if num_of_columns>0 col2_text to be visible if num_of_columns>1 however, processwire isn't saving that setting and so it ignores it. I'm on PW 2.4.0 and I'm trying to build some kind of dynamic table creator (it will be limited to 5 columns max) with a decent UI, so people can easily track the columns, having the columns in tabs or making it to where someone could accidently make 3 colums in one row and 4 in the other isn't good and so this is the solution I've come up with, but its not working for some reason
  15. I'm working on a site with an about-the-team page where we have a sub-page for each different area of specialty. Each one of these pages will have a list of people who are in that specialty, this list built by pulling 'person' pages that were assigned to that specialty page through a page field. With me so far? Here's the fun part. I want to add a "level" to each of the people that show up on a specialty page. So let's say I'm on the Widget Managers specialty page, and I have the 'people' page field set to pull Alice and Bob to appear listed on this page. But I want Alice to be a 'senior' widget manager and Bob to be a 'junior' widget manager. I could just put a field in the Person page type that lets me set that person's level, but wait! A person can be assigned to more than one specialty page, with different levels on each one! So Alice might be a senior widget manager and a junior doohickey wrangler. She has to show up on the widget managers page as senior, and on the doohickey wranglers page as junior. Ideally, I'd have a repeater field containing two page fields, one to select a person and one to select their level on the current specialty page, but repeaters can't contain page fields. Anyone know of a way I might approach this?
  16. I saw in a previous post (about a year ago) that pagination for repeaters was on the roadmap. Is this working yet or an eta? I'm hoping you'll chime in on this Ryan. Thanks! I'm currently working on a site where I have a repeater setup for a portfolio that filters the images by category. So in the repeater I have two fields (category - radio options, and image). But I also need to paginate through the images.
  17. I've been trying to do the following: I have 2 repeaters in a template and a I want to limit those repeaters to a number stored in another page. That number is then called in the template via a Select field (which is a Page relation). So when the user is editing the page, if the select says 3, then there are only 3 items allowed in the repeater. Should the user create 4, then a validation error should show up. How difficult is this to achieve? I've been reading this related thread but I still don't get it.
  18. Hi Guys, I am absolutely loving Processwire but need some assistance in a custom build. I have created a repeater for an internal page. I need to pull the data using GET or some other way to display the first five repeated sets onto my home page for my featured items section. Is this possible? If so, any examples? Guidance? Your help is much appreciated!
  19. Hi Guys, I am pretty new to process wire and am experimenting with repeater fields. The issue is that the image cannot be found via the URL but im not sure why? Im sure this is something silly however I cannot see the problem. The image is uploading fine via the content management system however when viewing on screen it comes as though the image cannot be found. All help would be greatly appreciated. Thanks, Melissa <?php foreach($page->about_timeline_left as $about) { $image_left = $about->left_images; echo "<div class='ss-row'> <div class='ss-left'> <img src='{$image_left->url}' alt='{$image_left->description}'><a class='ss-circle ss-circle-1 ss-circle-deco'></a></div> <div class='ss-right'> {$about->right_description} </div> </div>"; } ?>
  20. Hi there, I have a single page website. This single page website has a section that includes posts that have their own content already displayed on the page. What do you recommend, should it be best to maintain the repeater structure or should I make this section based on pages? (you can think of this like a blog, but the content is already within the main page, thus making it a single-page website) Thanks in advance
  21. Hi, i have a problem with the repeaters; i can't delete or modify the item from a repeater; when i delete de repeater field from the page and then add again some of the value have still present. i dont understand this error. what can i do?
  22. Hi, im trying to play with the repeaters; i read the excellent tutorial on this page and made some groups for a project but i have a few questions. Is possible to every item for a repeater (item) be collapsed in the panel admin? Is possible change the title for the row, to know his content without need to click then? Regards.
  23. Hi! I'm currently working on a project that lists chairs. Each chair comes in multiple colors. Each chair has a repeater field with 2 fields: an upload a photo field and a select (which is a Page field) so you can associate the photo with a color from the select. From the Color perspective. Each color has been aplied to a number of chairs, and I want to have a page for the color "Red" and list all red chairs but show the red color image of that chair. So I need to find all chairs which are in red (this gets selected with another field but not inside a repeater). Then inside the loop I look for a repeater instance that has the color red. Everything good till the point I don't know how to find the photo adjacent to the color red. That is, the field in the same line of the repeater. I only need the full row which is the red thumbnail and leave the rest behind, I think I might be over complicating somehow... I'm really lost. Is this the right way? I guess this might be difficult to explain. Let me paste some code and an image for the Chair element with the repeater: $chairs = $pages->find('colores='.$page->name); $i = 0; if($chairs) { foreach($chairs as $chair) { $i++; $additionalClass = ($i % 3) == 0 ? " last" : ""; ?> <div class="item <?php echo $additionalClass ;?>"> <a href="<?php echo $chair->url ;?>"> <?php $chair_color_photos = $chair->producto_color_thumbs; // The repeater field. Contains rows with color names -> thumbnail $color_thumb = ''; // Find the red color name and photo if($chair_color_photos) { foreach ($chair_color_photos as $color_photo) { if($color_photo->producto_color_thumbs_opcion == $page) { // $page is Red $color_thumb = $color_photo->producto_color_thumbs_opcion; } } } if($color_thumb) { // Find the Red photo ?? } elseif($chair->producto_thumb) { echo "<img src='{$chair->producto_thumb->url}' alt='' />"; } echo "<hgroup class='descripcion'>"; echo "<h3>{$chair->title}</h3>"; echo "<h4>{$chair->summary}</h4>"; echo "</hgroup>"; ?> </a> </div><!-- .item --> <?php } }
  24. Hello, Is there a way to group together fields, like in a repeater field, but only allow there to be one set per template? I looked into the fieldtab field but this doesn't allow for certain features that a repeater would - ie, allow the same field to be used at least twice within a page (eg, outside a repeater and within a repeater), and to add a group of fields into a template as one chunk. This would seem like a handy feature feature and I'm probably missing something! Many thanks in advance, ben
  25. Hi, delete($page, true) doesn't seem to delete my repeater fields. It's version 2.3.0 so this fix is included: https://github.com/ryancramerdesign/ProcessWire/commit/b2780236a2643d703c586a23991d80e2e6b171bf I'm deleting a large amount of pages and inserting them again (working on a CMS conversion). The weird thing is that unless I delete all pages, and then all repeater pages, I can't insert any repeaters again. I have to clear out the DB from both pages and repeaters before I can insert anything again - otherwise no repeaters are stored More weird: Unless I do the delete in a separate GET, it doesn't work either. I have to first delete all stuff $events = $pages->get('/events'); $events_children = $events->children(); foreach($events_children as $c) { $pages->delete($c, true); } $times = $pages->get('/processwire/repeaters/for-field-112/for-page-0/')->children(); foreach($times as $t) { $pages->delete($t, true); } and then fill in the new values: for($n=1; $n<10; $n++) { $event = new Page(); $event->parent= $pages->get('/events'); $event->template = $templates->get('event'); $event->title = 'Event hello #' . $n; //insert two times (repeater fields) per event for($t=0; $t<2; $t++) { $time = $event->times->getNew(); echo $time->id . '</br>'; $time->title = 'Time #' . $t; echo $time; $time->startdate = rand_date('2011-01-01', '2013-12-01'); $time->save(); } $event->save(); } If I don't do it in two steps the times values are not inserted. thanks! rgds, J
×
×
  • Create New...