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 folks, I have a repeater set up on a 'fabrics' page. When you add a fabric, you then add an image and a colour (per row on a repeater); the colour field is a pageField which lists out all the colours from the Colours section. See screenshot for an example. Across the site, where 'related fabrics' come into play, the client will choose, via a pageField, all the relevant fabrics and it'll take the first row of the repeater (image and assigning colour) and display it. See second screenshot as an example. This is all good and works BUT there is one section of the site 'In-Situ' where the client would have to choose a specific colour from a fabric (and not just the fabric). As the image/colour combos are set up as a repeater (which are added as pages in the CMS under 'Admin > Repeaters' (which is amazing) I can simply tell a pageField, using a custom selector, to show each 'row' from across the site (which would return all the images and colour options for each fabric). template=repeater_collections_detail_images, include=hidden, sort=name This works a treat. I can then use the custom page label format which would return the parent title of the page it's on and then the title of the colour chosen. {parent.title} – {collections_detail_image_colour.title} I have one issue, however. The parent.title isn't user-friendly and is rather the canonical title of the page, not the actual title of the page, so looks more like a name than a title. See the third and fourth screenshot as an example. The only thing I can think of is that these repeaters and their rows are on these specific fabric pages, right? So is there a way for the custom page label format to return the title of THAT page and not the repeater page? See my final screenshot for what I mean. The repeater has a path, for example, .../for-page-1080/ and the page 1080 that it is referring to is the page of the title I am trying to get. Any ideas? I realise this is a little long-winded but any help or advice would be appreciated.
  2. 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
  3. 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?
  4. 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?
  5. 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
  6. 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?
  7. Afternoon, I have a page setup with a repeater which has 40 or so items in. Each repeater item has around 6 fields. This is becoming a little unusable so I'd like to convert them to child pages of the current parent. Is there a way to do this (import/export maybe?) Many thanks Pete
  8. 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 -->"; } } ?>
  9. 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
  10. From time to time people run into this issue: https://processwire.com/talk/topic/13089-repeater-field-limits-and-server-timeouts/ So the idea is simple: Admin > Setup > Fields > Details (tab) > Maximum items allowed / 0 = No limit Something like the one for images. And may be a nice little yellow boxed notice underneath, about why it is a good idea to impose a limit... I love these inline help bits, they help me a lot. EDIT: I forgot to add that - of course - we also need some GUI voodoo to support it.
  11. 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();
  12. 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.
  13. 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?
  14. 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
  15. Hi, following scenario: I have a Single-Page implemented with ProcessWire (So i got only one page in the Backend) The customer wants me to implement a functionality which recognize the current saved item of the repeater and publish it to his facebook-page. But this is my problem. I don't see any possibility to "catch" this last-saved entry of the repeater programmatically. This here is my repeater The name of the repeater is "referencesList" (the field-name) Do i have to programm a module for this plan? Thank you very much in advance for your answer
  16. Hello All, I am trying to upload multiple PDF files into one repeater field. The exact situation is, if someone submits the form. make newItem in repeater add all the PDFs in newItem. every thing is working without repeaters(files not getting replaced). But in repeater, only last file remains exist.Other PDFs getting replaced from the newItem field of repeater. My code looks like- $p2= pages->get($id); $pdfs = new WireUpload('f_plan'); $pdfs->setMaxFiles(8); $pdfs->setOverwrite(false); $pdfs->setDestinationPath($upload_path); $pdfs->setValidExtensions(array('pdf','xps')); // execute upload and check for errors $pdf_files = $pdfs->execute(); echo count($pdf_files); //count is working if(!count($pdf_files)) { $pdfs->error("Sorry, but you need to add a photo!"); return false; } foreach($pdf_files as $filename) { $p2->of(false); $new_rep = $p2->floor_plan_rep->getNew(); $p2->save(); echo $pathname = $upload_path . $filename; //all the urls are okey $new_rep->floor_plan = $pathname; $p2->save(); $p2->of(true); unlink($pathname); } Also it is making one extra blank repeater field inside repeater.(I know something is wrong and something is missing in my code. ). Please help. Thanks
  17. Ok, so I have been scratching my head on this one for the last hour. I had three repeaters that I needed to delete from the list to create some new ones (I removed them from the template via actions). However when I go to delete the repeater, it is saying it is still use by 3 other pages. I am at a loss of what to do.
  18. 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
  19. I'm using a repeater field for holding stock levels of different items and when all the rows' quantity columns equal 0, I want to set another stock checkbox field to off. I'm doing this in the template that displays the product: foreach($page->inventory as $stock) : $stock_total += $stock->qty; if($stock_total==0) : $page->of(false); $page->stock = false; $page->save(); endif; endforeach; but it's setting $page->stock to off whenever the page is refreshed regardless of whether $stock_total = 0 or not. Why is that?
  20. Hi folks, I have a repeater field set up and there's a few issues with the usability that I was curious to know if there were any options to improve this? Is it possible to make a repeater element add to the top, rather than the bottom? I know you can drag/drop but if it's a long repeater then it can get clumsy. If the possible isn't an option, is it possible to have the repeater rows collapsed by default? Any thoughts?
  21. Hello @ all, today I am struggeling with the deletion of empty repeater items after saving in the backend. Explaination: Imagine you are adding an additional repeater item in your form in a page via the "Add button". Then you forget to fill out this item so it is empty. After submitting the form the empty repeater item is still there because you did not deleted it with the basket symbol (deletion) Goal: In theory it must be possible to create a hook that checks the repeater items for content and delete the empty items after saving. At the moment I dont know how to check if an item is empty or not. I know how to delete fields in the repeater item but not the complete item itself. Can anyone point me into the right direction? Best regards
  22. Hello, I just thought I'd mention this, I'll most likely post on GitHub. I just want to make sure I'm not being a total newbie. Introduction I'm creating case studies that will have a slider. For this I've opted for repeater over PageFields as it will only have the fields, text and image. I understand that PageFields are the way to go over repeaters, however I felt creating new pages and using the iFrame to edit might be a little too much for this particular project. (Correct me if I'm wrong, I'm new to ProcessWire) The Problem I have created a tab called Slider, in this there is a repeater that has a few fields. However, when I add content to this field and save, the content does not save. How to reproduce Create a tab Add a repeater to the tab Add content to the repeater and save The content should disappear. If it doesn't then I must be doing something wrong, somewhere. Thanks, Tom
  23. Recently I was in trouble filling a repeater inside a foreach loop (Creating pages from a CVS File). One of the steps in my script was delete all existing pages before start creating new ones. Discovered that after using $page->delete() and create a new page I could't fill my repeater fields. Then if I use $page->trash() no problem, and the repeater's were created and correctly filled. What's the difference between delete and trash? Is there some internal pointer that get lost when delete() is called affecting the behaviour of the New() function or getNew()? The original problem is in this tread: https://processwire.com/talk/topic/11130-problem-addingpopulating-repeater-using-api/ Thank's.
  24. i have a repeater with 2 fields – image – text if there are images uploaded then the output should be only the image field. if no images uploaded, then only the text-field should be shown right now, if the image-field is empty and the text-field is filled. i'm getting two boxes. and the first one is empty. <?php foreach($page->repeater as $box) { if($box->images) { ?> <div class="box images"> <?php foreach($box->images as $image) { echo "<img src='$image->url'/>"; } ?> </div> <?php } else { } if($box->text) { ?> <div class="box text"><?php echo $box->text; ?></div> <?php } } ?>
  25. Hello, first thanks for this awesome project. My question is, I'm importing data from a CSV into pages whose template has a repeater, everything in the page fill's correctly(It even has images attached to it) but no repeater's are added. Something like page(song) -> repeater(videos of the song) I copied the code from http://processwire.com/api/fieldtypes/repeaters/ wich is the "Default" or basic way to populate a repeater using API. require("../../../index.php"); //Add processwire index (Bootstraping) $template = wire('templates')->get("song"); $parent = wire('pages')->get("/container-songs/"); //Array $rows_from_csv has been previously filled and is correct //The template has a repeater field called rep_videos foreach($rows_from_csv as $key=>$song) { //Start creating each page //$esiste = wire('pages')->get("template=canzone,title=$canzone[titolo]"); $p = new Page(); $p->of(false); $p->template= $template; $p->parent= $parent; $p->title=$key; $p->titolo=$song['title']; $p->testo=$song['text']; $p->description=$song['descrip']; $i++; //Load the repeater for each video the song has foreach ($song['videos'] AS $v) { if ($v<>'') { $i++; $repeater = $p->rep_videos->getNew(); $repeater->title="$key-$i"; $repeater->video_url = 'http://www.youtube.com/watch?v='.$v; $repeater->save(); $p->rep_videos->add($repeater); $p->save(); } } } Maybe the problem is that the code segment is inside a foreach? I've tryed different approaches, like saving the page before the loop that try to creates the repeater but returns an error: Error: Uncaught exception WireException with message Can't save page 0: /1444373775-0463-1/: It has no parent I've tryed saving the page after the foreach so each element of the repeater remain's in memory until finish adding new element's (Video url in this case) with no positive results. Even tryed to create the repeater of the foreach using literally the code from Repeaters Page Any help will be appreciated.
×
×
  • Create New...