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. I'm working on a production site from 2012, running Processwire 2.3. We have an image field called 'main_teaser_image' that's used by various teasers/widgets across the site. When the image field is used in a standard widget, both Superusers and Editors can edit/crop the image. However, when the image is inside a Repeater field (used to create slider/carousel widgets), only Superusers can edit/crop the image. Editors receive the error: 'Not Editable' (see screenshot). I have tried to adjust the main role permissions, the page permissions and template (widget) permissions, all to no avail Any help would be greatly appreciated... I'm gonna get a coffee...
  2. Hi, I'm experiencing error on saving a page with multiple repeater fields. Any clue on a solution is welcome. Updating to the repeater field pages under the Admin work as expected though. NIcolas
  3. Hello! We are currently using ProcessWire 2.7.2 for one of our sites and we're having a bit of a problem with an Image field. The field is configured to display images using the "Rows" view, display thumbnails in page editor and it has a maximum of 1 allowed file. However, when the field is rendered within a Repeater item, it defaults to the "Grid" view, completely ignoring that I had selected the "Rows" view while configuring the field. I feel that this is bad UX for the user, because if he/she wants to use the little trash can icon to delete the uploaded image, the user *needs* to know that he/she has to click the View Toggle icon first, in order to get to the "Rows" view. I want "Rows" view to be the default, so the user immediately sees the trash can icon once an image is uploaded. What do you think?
  4. Hi folks, I have a production site which has been fine for the first few months but the client is now experiencing an issue with uploading further images to a repeater field. I've replicated the problem myself and get the same result. They have uploaded the first 9 items but can't upload the 10th and beyond. The repeater field uses an image uploader then two text fields for each item to form an image gallery. We have 9 items uploaded with no problem but when we try and a 10th (and 11th etc.) the image gets uploaded OK on editing but when we go to save the page (and the admin page refreshes) the the image is gone leaving just the text fields populated and the text 'No file chosen' next to the image upload button. One thing I have noticed when looking at the site/assets/files directory folder is the last image that loaded OK is at ID 1091 and there are already folders at IDs 1092, 1093 etc. I'm not sure how PW issues new IDs but I thought it might be related. I've used repeaters for these things before (up to 43 items on one site...) but I'm foxed by it here. Host: Fasthosts Ignite PW: 2.7.2 Can anyone give me guidance or has anyone seen this on their own sites? Thanks!
  5. So I know when you create a repeater you have the chance to select how many fields will be created before you have to save, but I unfortunately created several (10 repeaters) that have started to create a mess. Is there a way to go back to the repeater and edit it to show only 1 so it will stop creating templates? I went back to edit but I did not see this option anywhere.
  6. I have a module that creates a repeater field on install: $f = new Field(); $f->type = wire('modules')->get('FieldtypeFieldsetTabOpen'); $f->set("name", "iu_maptab")->set("label", "Mapping"); $f->set("tags", "impupd")->save(); $r = new Field(); $rName = "iu_map"; $r->type = wire('modules')->get('FieldtypeRepeater'); $r->set("name", $rName)->set("label", "Map Fields"); $r->set("tags", "impupd")->save(); $f = new Field(); $f->type = wire('modules')->get('FieldtypeSelectExtOption'); $f->set("name", "iu_field")->set("label", "Template Field"); $f->option_table = "fields"; $f->option_value = "id"; $f->option_label = "name"; $f->set("tags", "impupd")->set("columnWidth",50)->save(); $f = new Field(); $f->type = wire('modules')->get('FieldtypeText'); $f->set("name", "iu_value")->set("label", "Source Value Selector"); $f->set("tags", "impupd")->set("columnWidth",50)->save(); $f = new Field(); $f->type = wire('modules')->get('FieldtypeCheckbox'); $f->set("name", "iu_static")->set("label", "Use Static Value"); $f->set("tags", "impupd")->set("columnWidth",50)->save(); $f = new Field(); $f->type = wire('modules')->get('FieldtypeFieldsetClose'); $f->set("name", "iu_maptab_close");//->set("label", "Mapping"); $f->set("tags", "impupd")->save(); $rfg = new Fieldgroup(); $rfg->name = "repeater_{$rName}"; $rFields = ["iu_field", "iu_value", "iu_static"]; foreach($rFields as $rf) { $rfg->append($this->fields->get($rf)); } $rfg->save(); $rt = new Template(); $rt->name = "repeater_$rName"; $rt->flags = 8; $rt->noChildren = 1; $rt->noParents = 1; $rt->noGlobal = 1; $rt->slashUrls = 1; $rt->fieldgroup = $rfg; $rt->save(); $rpg = "for-field-{$r->id}"; $r->parent_id = $this->pages->get("name=$rpg")->id; $r->template_id = $rt->id; $r->repeaterReadyItems = 3; foreach($rfields as $rf) { $r->repeaterFields = $this->fields->get($rf); } $r->save(); Now I can't uninstall it, on account of a field being used in the fieldgroup created for the repeater -- can't delete that field because it's in the fieldgroup which I am trying and failing to delete: $rf = wire('fields')->get('iu_map'); $rt = wire('templates')->get('repeater_iu_map'); $rfg = $rt->fieldgroup; if($rf) { wire('fields')->delete($rf); wire('fieldgroups')->delete($rfg); wire('templates')->delete($rt); } foreach(wire('fields')->find("tags*=impupd") as $f) { wire('fields')->delete($f); } Please help this is such a bother. The fieldgroup should be deleted before attempting to delete the field itself.
  7. I have an application where a repeater called 'newsletterrepeater' has field like this $newsletterrepeater = $page->newsletterrepeater->sort('-date'); foreach($newsletterrepeater as $n){ echo $n->date.$n->title.$n->file; } The field types are: date = dateTime field title = text field file = file field I want to group the entries into months. See code below where [[ ]] is my unknown code. foreach ($newsletterrepeater as $n) { [[ foreach month ]] <table> <tr> <th colspan="3"> [[month]] </th> </tr> echo ' <tr> <td>'.$n->date.'</td> <td>'.$n->title.'</td> <td><a target="_blank" href="'.$n->file->url.'">Download Newsletter</a></td> </tr>'; </table> }
  8. In my template I have an UL (see code example 1) which I am converting to the ProcessWire CMS. Now I am unsure how to do this... and I have done the code on the repeater via the docs example (see code example 2) but I am not getting any results. My backend is setup with a repeater field called home_slider and inside the repeater is: [ image is sliderimg title is slider_title and text is slider_text]. Thanks! CODE EXAMPLE 1: <ul class="orbit-container"> <button aria-label="previous" class="orbit-previous"><span class="show-for-sr">Previous Slide</span>◀</button> <button aria-label="next" class="orbit-next"><span class="show-for-sr">Next Slide</span>▶</button> <li class="orbit-slide"> <div class="clearfix"> <div class="small-12 large-10 large-centered columns"> <div class="featured-image float-left"> <img src="/assets/img/sans-graphic.jpg" style="height:340px;width:auto;" alt="Scrolling Featured Images"/></div> <div class="featured-text"> <h3>SANS</h3> <p>The Submarine Acoustic Navigation System Beacon is an undersea, bottom-mounted...</p> <a href="/technology.html" class="button">Read More</a> </div> </div> </div> </li> <li class="orbit-slide"> <div class="clearfix"> <div class="small-12 large-10 large-centered columns"> <div class="featured-image float-left"> <img src="/assets/img/smart.jpg" style="height:340px;width:auto;" alt="Scrolling Featured Images"/> </div> <div class="featured-text"> <h3>SMART</h3> <p>Standardized Metrics Assesments of Readiness and Training is an analysis tool...</p> <a href="/technology.html" class="button">Read More</a> </div> </div> </div> </li> <li class="orbit-slide"> <div class="clearfix"> <div class="small-12 large-10 large-centered columns"> <div class="featured-image float-left"> <img src="/assets/img/acms/acms-2.png" style="height:340px;width:auto;" alt="Scrolling Featured Images"/> </div> <div class="featured-text"> <h3>ACMS</h3> <p>Advanced Contact Management Systems aids commanding officers in gathering actionable sonar information...</p> <a href="/technology.html" class="button">Read More</a> </div> </div> </div> </li> </ul> CODE EXAMPLE 2: <? foreach($page->home_sliders as $home_slider) { <li class='orbit-slide'> <div class='clearfix'> <div class='small-12 large-10 large-centered columns'> <div class='featured-image float-left'> echo "<img src='{$home_slider->sliderimg}' style='height:340px;width:auto;' alt='Scrolling Featured Images'/>"; </div> <div class='featured-text'> echo "<h3>{$home_slider->slider_title}</h3>"; echo "<p>{$home_slider->slider_text}</p>"; echo "<a href='{$home_slider->slider_btn_url}' class='button'>Read More</a>"; </div> </div> </div> </li> } ?>
  9. For a school project I want to list all teachers on a page with their names, subjects and email addresses. I created 3 inputs, put them in a repeaterfield and created approx. 50 entries with teachers.(but only 5 email addresses) Frontend is rocketlike fast but in the backend the page takes more than 10 seconds to load AND save. I know, repeaterfields are not meant to hold large amount of content, but 50 entries? Not that much. The page in Admin -> Repeaters says under: Process "0" Is that correct? Or is that behavior normal for a repeater field? PW 2.7.0 Repeater 1.0.2
  10. Hello, I'm migrated a few hundred users from an old system to PW via API. I created users, they can log in etc but only one thing is not working. Users have repeater fields. After I create users I also create those repeaters but I cannot get their value from front-end of the website. But if I go to users editing page from admin I see the values in place correctly. And when I save the user from editing page (without changing anything just saving), it starts to work normally. What am I missing here, what should I do to achieve this by API? Thanks
  11. Hi I read tons of posts/tutorials about categories and variations on the same subject. However, I think there is something I don't understand or just use a wrong design. Does someone could kindly explain where is my problem? Directory (basic-page template) -- Category (links template) --- Link 1 (repeater) I have no problem to output the content of the repeater on his own page of category. However, my problem is to list everything on the directory page. I suppose I can do a $page->find("template=links") but it make no sense to add that on a general basic-page template. Or do I should have a specific template for the parent page? Or some kind of function I can reuse? (I have the exact same problem for my gallery page with a category and their children) Thanks. Mel Links template $content .= $page->render('links'); /Fields/links function renderLinks($page) { foreach($page->links as $link) { echo "<h2><a href='{$link->http_link}'>{$link->title}</a></h2>"; echo "<p>{$link->summary}</p>"; echo "<p><a href='{$link->one_image->url}'><img src='{$link->one_image->url}' alt='{$link->one_image->description}' ></a></p>"; } } $content = renderLinks($page);
  12. Hi, for a site about adoption of dogs (laboratory beagles) we need a solution for display and filter records (700). Every record has identical fields (name of the dog, age, gender, pictures and name, address, phone number of the person who wants a dog and so on). It should be very easy for the admin of the site to make new entries/change entries and filter for specific entries in the backend. In the fronted there should be a possibility to filter entries too (maybe someone is searching a dog with a specific age). How can i do that? Use Repeater Fields to create the records? There are about 60 entries (textfields, radio buttons, select fields ...) in every record. Is this "to much" or are Repeater Fields able to handle this? For the filter part i'm sure that the Lister Pro ist the right solution, right? Mario
  13. Hi everyone, I'm new to processwire and have just started playing around with it for the past week. At the moment, I'm trying to use repeater fields and am having difficulty getting them to output to my page. Instead, what bizarrely seems to be happening is that half of the foreach loop declaration seems to be appearing as plain text on my page and is commented out when I check inspect element. I'm not sure if my syntax is wrong or this is an entirely different problem. Any help would be hugely appreciated! Here's my code: <?php $portfolio=$pages->get("name=portfolio");?> <? foreach ($portfolio->portfoliopreviews as $portfoliopreview): ?> <a href="#"> <div class="port"> <img class="pic" src="<?=$portfoliopreview->portimg->url;?>"/> <div class="portbgrdtext"> <h5><?=$portfoliopreview->portgenre;?></h5> <p><?=$portfoliopreview->porttext;?></p> <button class="portbtn">Read More</button> </div> </div> </a> <? endforeach; ?> And in the attached images you can see what's happening on the page and within inspect element. You can see that the div is being created, albeit without any fields populating inside of it. You can also see that loop is being commented out within inspect element. Cheers!
  14. In reference to http://processwire.com/api/fieldtypes/repeaters/ is it possible to say 'where all repeater items' rather than 'where at least one repeater item' inside your selector? What I have is a repeater with a checkbox. I want to find pages where all repeater items on the page are checked or unchecked. If I do this: $pages->find("my_repeater.my_checkbox>1"); I get pages where at least one repeater item has the checkbox ticked, but what I want is pages where the checkbox is ticked in all of the repeaters.
  15. Hi guys Is there a way to call a Repeater content and specify that Repeater item 1 should use mini template "odd" repeater item 2 should use mini template "even". I think that's half my battle. Basically, I have a weird little grid of cubes as follows I have it all working as basic CSS and HTML but I now need to make it client edit friendly. I have some complexity in that: 1. Each text panel has a unique color (ideally specified by CSS) 2. On each row, the photo and text are on different sides I was wondering if a repeater would work. I can certainly use that to allow client to add raw text and image. I then realised that allowing the client to add content isn't the challenge as much as outputting it correctly on the front end. I'm having trouble understanding how I can tell the page to Make Row 1 use this blue background. Put the image on the right. Make Row 2 use this pink background. Put the image on the left. Make Row 3 use this other blue background. Put the image on the right. I could always resort to plain non-repeater fields but I'd then have 6 fields etc
  16. Hey all, I have an image and text field in a repeater. When I iterate over repeater using foreach loop, image is not returned (null is returned instead), but text field is. Some (I guess) useful information: I am using ProcessWire 3.0.17 Image field supports svg format (jpg in not returned either) Image filed is limited to one file and is without description Image field's format is set as 'single or null', but array with field->first or field->eq(0) also doesn't work Images are uploaded to server I used the same approach foreach($page->repeater as $item) $item->image->url a dozen time before in older versions, so I wonder if something maybe changed in v3? I ran out of ideas what could be wrong and what I need to change, so I hope you'll be able to help me Thanks! Žiga PS. I also noticed that I cannot add description to .svg images. Is there a special reason for this?
  17. I have a small issue with my $pages->find query. My pages have a repeater field that is a checkbox. I'm trying to sort the results so that I get pages where at least one of the repeaters has the checkbox field checked. What I'm doing currently is: $my_pages = $pages->find("sort=-my_repeater.my_checkbox_field"); So I'm sorting high to low, i.e. checked before not checked. The issue is that it only appears to take into account the checked status of the first repeater item. If the second, third etc is checked, the page is not appearing at the top of the results. I'm guessing there must be an easy way to check all items in the repeater?
  18. Hi, for a download area i wanna use a repeater field with a text field (description of that download) and a file field (the download file). The repeater field is "downloads" and it contains the fields "body_part_1" and "download_files". When i use this: <div class="uk-grid"> <?php foreach($page->downloads as $download): ?> <div class="uk-width-4-6"> <?php echo $download->body_part_1; ?> </div> <div class="uk-width-2-6"> <?php $file = $download->download_files; if($file) echo "<a class='download-links' href='$file->url'>$file->description</a>"; ?> </div> <?php endforeach; ?> </div> the output is this: <div class="uk-width-2-6"> <a class='download-links' href='/site/assets/files/1083/'></a> </div> The text (body_part_1) is ok, but no description inside the link and the path lacks the filename. Of course it's my fault, but what i'm doing wrong?
  19. Hey all. I have a repeater with single textfield items. Everything is working fine till I reach 51 items. When I want to add the 52th, I get a 500 Internal Server Error and the page is not editable anymore...I have to delete the page and start from scatch. Can anyone think of a reason for that? And of course a solution? Thanks a lot!! [EDIT] I am running: - ProcessWire 2.7.2 - FieldtypeRepeater 1.0.2 - MySql Server Version: 5.5.47-0 - PHP Version 5.6.21
  20. I'm creating my first site with PW. I've seen several posts on this and I think I'm doing it the same way, but I can't make this work. I have a repeater set up on a news page. The items display on that page correctly. I also want some of the items from the news repeater to display on the home page. (I'm going to use a checkbox in the repeater to determine which ones, but I can't get any of them to appear right now). The $pages->get() appears to be returning the correct page, but nothing is displayed. I've used the page name and ID in the get(). Code on the news page works correctly: <?php foreach($page->news_items as $news) { echo "<div class='news'>"; echo "<h2>{$news->heading}</h2>"; echo "{$news->body}"; echo "</div> <!-- news -->"; } ?> Code on the home page that DOES NOT work: This code never gets into the foreach loop. The echo "news" line is never printed. No idea what I am missing. <?php $newspage = $pages->get("/union-county-fair-news/"); echo $newspage." page"; foreach($newspage->$news_items as $news) { echo "news".$news; if ($news->show_home_page == 1) { echo "checked"; echo "<div class='news'>"; echo "<h2>{$news->heading}</h2>"; echo "{$news->body}"; echo "</div> <!-- news -->"; } } ?>
  21. Hi, another stupid question from a PW newbie. I'm working on a page which displays team members with some information (name, phone number, ...). For the person who edits these infos later i wanna make it as simple as possible to change the entries. I was trying to use the repeater field for some sort of grouping the infos for the several team members in the backend. This works like expected. But how to display the entries in the frontend? There i need the separate fields (name, number ...) to be able to do a formatting. Is there another way of grouping the fields in the backend, but access the individual fields for displaying in the frontend? Mario
  22. My site has three language, default, chs, eng. Default language is cht (traditional chinese) I have an order template (no output template). Structure look like An order will be created after a successful paypal transaction has been made. When I'm on default language, the order creation is working properly. However, if I switched to chs or eng The order number field i.e. title field cannot be inserted. I just saw an empty title field. All other fields are populated values properly, except the order number Here is my page creation code $p = new Page(); $orderByUser = $user; $p->template = "order"; $counter_name = $order_number_prefix . date('Y'); $number = $this->modules->get('DatabaseCounters')->next($counter_name, 1, 5000); $ordernumber = $counter_name . '-' . sprintf("%06u", $number); $p->title = $ordernumber; $p->member = $orderByUser; $p->payment_method = $session->get("payment_method"); $p->order_time = $session->get("order_time"); $p->paypal_transaction_id = $session->get("paypal_transaction_id"); foreach($session->get("cart_item") as $cart_item) { // create order items $item = $p->order_items->getNew(); $item->product_id = $cart_item['id']; $item->product_name = $cart_item['name']; $item->product_price = $cart_item['price']; $item->product_quantity = $cart_item['quantity']; $item->save(); $p->order_items->add($item); $transaction_amount += ($cart_item['price'] * $cart_item['quantity']); } $p->transaction_amount = $transaction_amount; $p->of(false); $p->save();
  23. I used a repeater field on my site to handle arrest reports. (It's much easier for the user than say adding a new entry for each person arrested as you would a new page). Basically, my client creates a new entry with the arrest report section then starts adding repeater "records" and data which include: name dob offense mugshot ... repeat the above for each offender This is a small county newspaper and we rarely have over 100 arrests listed per report. I noticed when about 60 repeaters are added after that I get a server timeout when trying to edit the page. I bumped up max_execution_time to 90 seconds and I get a 500 error. When I set max_execution_time to 60 seconds it loads -- but that is really pushing it. It was my belief that the Repeater field type could handle lots of repeaters, with the exception of getting into say a thousand or more, but 60-70? This may take care of it for this project, but, I'm thinking about future projects. I noticed that ProFields has a Table field type and watched the video, however, I didn't see any option of adding an image field in there. Is that possible? This would allow for fast entry of data with the addition of an image for each record. Any other suggestions are appreciated. thanks.
  24. I wish to show various bits of information on a File repeater (extension, filesize etc). The filename shows correctly, but the links to the files open the admin area, the file extension is empty and the filesize too. function renderDocumentLibrary($page) { $out = ""; if ($page->document_download->count()) { print_R($page); $out .= "<div class='row downloads'>"; foreach($page->document_download as $download) { $out .= "<div class='col-xs-12 col-sm-6'>"; $out .= "<div class='download clearfix'>"; $out .= "<a href='{$download->url}'><img src='{$download->ext}' alt='Download {$download->document_name}' class='download-icon' /></a>"; $out .= "<div class='download-content'>"; $out .= "<span class='download-date'>" . date('d.m.y', $download->modified) . "</span><br />"; $out .= "<h2 class='h4'>{$download->document_name}</h2>"; $out .= "<a href='{$download->url}' class='download-link'>Download {$download->ext} ({$download->filesizeStr})</a></div>"; $out .= "</div></div>"; } $out .= "</div>"; } return $out; } Can I access those attributes in this way?
  25. Hi there, I have a little problem with a repeater that I'm using for events, containing three fields: start_date, end_date, description On the homepage, I want to display the upcoming two events. So I have to filter out past events, sort by the dagte and set a limit for the output I thought I could do it with something like the following code, but there's no output: $nextevents = $pages->get("template=events")->events->find("end_date>today, sort=end_date, limit=2"); foreach($events as $event) : ?> <li class="future-event"><?= $event->end_date ?><span><?= $event->description ?></span></li> <?php endforeach ?> the template of the repeater is called "events" and the repeater field's name is also "events" I guess it can't be that difficult, but after trying different things and looking through the docs, I still have no idea how to solve it. Would be great if someone can help! Thanks
×
×
  • Create New...