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 have a page with similar repeater fields of various names, and similar output in a loop so i really don't really want to write endless foreach repeater for rendering but need to aggregate all repeater fields and then pass them via one foreach loop $repeaters=$pages->get("/advert_page/"); foreach($repeaters->fields as $repeator){ if($repeator=="title")continue; echo $repeator->summary; echo $repeator->images->first; } it simply doesnt work, so i have to manually do for each repeater $repeater=$pages->get("/advert_page/"); foreach($repeater->Media as $m) { echo "<img src='{$m->images->first()->size(120, 60)->url}'>"; echo "<p>Year built: {$m->summary} </p>"; } echo '</div><div class="uk-grid uk-grid-width-medium-1-4" data-uk-grid-margin="">"'; foreach($repeater->featured as $m) { echo "<img src='{$m->images->first()->size(120, 60)->url}'>"; echo "<p>Year built: {$m->summary} </p>";
  2. Hello, I'm new to PW and like it already I have just created my first site with PW and need some help getting repeater posts from one page to expl. home page. I have a page called Events with template events.php . Page has a repeater field called Events_repeat. Now I would like to show last three events on a homepage, how do I do that. I have tried with: <?php foreach ( $pages->find('template=events, limit=3') as $event ):?> <div class="hovereffect"> <img src="<?=$event->images->first->url ?>" width="100%" class="img-responsive" style="border: 9px solid white;"> <div class="overlay"> <h2><?= $event->images->description->first ?></h2> </div> </div> <? endforeach; ?> But it doesn't work, what am I doing wrong. I tried to look on a forum but couldn't find anything helpful really. Thank you very much R
  3. Hi there! And thanks for Processwire which i really like! Got a specific repeater-related question which i couldn't resolve. Will appreciate any help. Let's imagine we have Places (pages), Offers (pages) and Partners (PW users). Any Place can have many Offers attached to it via a repeater field. Any Partner can have many Places (repeater or a multiple-value field). He can offer some Offers at each Place he is attached to. His Offers for any Place should be selectable only from Offers already attached to this Place. Partner-Places-Offers management should be performed in admin interface via PW input fields. The ideal solution which i imagined could be a "dynamic" partner_place_offers repeater where multiple Offers for a single Place could be selected from dynamically built list dependent on selected Place. But it appears that PW doesn't have such functionality yet. Thanks in advance for giving some idea on the subject!
  4. Thanks everyone for a perfect product! Got a problem during development of a website which has two different templates sharing the same "suboffers_prices" repeater field: the "offer" template and the "order" template. The idea is to take a single repeater item from offer page and to save it as a repeater item to a newly-created order page. Getting a single repeater is not complicated: $suboffers_prices = $pages->get("uid={$input->post->suboffers_prices_uid}"); But saving that suboffers_prices to a new order page appeas to be not that easy: $newOrder->suboffers_prices = $suboffers_prices; $newOrder->save(); //doesn't save the repeater ...another try... $newOrder->suboffers_prices = $suboffers_prices; $newOrder->suboffers_prices->save(); //in fact saves nothing ... $newOrder->save(); //doesn't save the repeater ...and another... $newOrder->suboffers_prices->getNew(); //$newOrder->suboffers_prices->of(false); //not callable in this context, PW crashes with error $newOrder->suboffers_prices = $suboffers_prices; $newOrder->suboffers_prices->save(); //again saves nothing ... $newOrder->save(); //again no repeater saved Tried some other approaches, still no result. Would like to get any advice on the best practice for saving a single repeater item to another page. Thanks in advance!
  5. Hello everyone! I recently downloaded ProcessWire and after playing around with it I've found its flexibility and ease of use to be really promising. I'm working on a site to publicize upcoming live music events and archive past events at our venue. Each event has the usual start time/end time/price/etc fields and can be associated with any number of bands (usually just one or two). Each band has name/website/description (short bio)/image fields. At the moment I have a page field on my event template allowing each event to be tagged with the required bands, either by choosing existing band pages (for bands which have played at our venue before) or by creating a new band page. I can then reference each band's name/website/description/image in the event template php. There are two key ways users will discover events on the public-facing site: 1) Through the events index page, listing events which can be filtered using dates and keywords 2) Through the band index page, listing bands whose pages will list past/upcoming events where they have performed. However, since: a) many bands have gone through minor lineup changes since they started playing at our venue, b) many bands have released (and want to promote) new material since they started playing at our venue, each band's description and image fields might (but not always) need to vary between events. I would like past event pages to show the band's description/image that was relevant when the event occurred, not the most recent revision. On adding band pages to new events pages, I would like the default description/image to be the most recent version for the band, with the option to replace this with a new description/image if required. It would be unnecessary to provide a new description/image for each band at each event if there were no lineup changes or releases of new material since they last performed. My first thought was to have a repeater field for description/image/start time/end time on the band template, where the start and end times help my php template decide which description and image to pair with a particular event. However, the band page field on the events template will not allow me to edit the referenced band page's attributes; it only lets me select band pages and reorder them. If I wanted to update the band description (while preserving the history of previous revisions) I would therefore have to find that band's page elsewhere in the admin then add a repeater row and enter the new description there, keeping the image field blank for that row if the image doesn't need updating. This would require the start time (of the new row) and end time (of the previous row) to be input manually... I'm convinced there must be a simpler way to maintain the links between events and band info. My current structure is: Home -- Events Index ---- Event 1 ---- Event 2 ---- Event 3 -- Bands Index ---- Band 1 ---- Band 2 ---- Band 3 Apologies if I've misused any terminology Could anyone advise on sensible strategies for achieving this using Core ProcessWire or modules? Thanks!
  6. Hi, how do I enable frontend editing for repeater fields? It partially works with foreach($page->repeater_field as $item) { >? <li><edit list_item><?= $item->list_item ?></edit></li> <?php } But if I click a frontend item the text disappears. I'm not sure if this is a bug or because it does not know which text it should reference. I tried with: foreach($page->repeater_field as $item) { >? <li><edit list_item_repeater<?= $item->id ?>><?= $item->list_item ?></edit></li> <?php } But that results in an exception.
  7. Hi, I was just playing around with the Repeater fieldtype and wondered if this might be a good fit for something I would call a "FieldCollection". In a FieldCollection the behavior should be exactly the same as in a Repeater fieldtype where minimum and maximum items are set to "1" – just the look and feel in the backend should be slightly different. Think of templates that share two or more fields for the exact same reason – e.g. a "published from" and a "published to" date field and a checkbox. Instead of adding those three fields to every template that needs them, why not create a FieldCollection? Changing the FieldCollection will change the fields on every page it is added to. The only caveat of using a Repeater item set to min and max 1 item is its appearance in the backend: Some of the Repeater features (delete item, add new item, ...) wouldn't be needed for that particular usecase. What do you think? Many greetings! Nik
  8. Hi, I have the following simplified layout on my page: ... row1_card1 - row1_card2 - row1_card3 row2_card1 - row2_card2 - row2_card3 ... You can add as many rows and cards per row as you like. Each card has a title, text and a button whose text is the same on every card but should be editable too, just not individually. I wonder what is the best approach to do this without making it awfully complicated to setup in the admin from an editors perspective. I thought about a solution using a PageTable for the rows and a Repeater for the cards but that started to be complicated to setup even. It would be awesome if you could use the FrontpageEditing to edit these cards and even add more or add rows. How would you implement it?
  9. How can i add a repeater field in a module's config?
  10. Hi everyone, i just experienced a bug/case where the backend did not save the repeater state in a matrixRepeater. I haven't found any post about this bug so i thought it might be interesting if other people experience the same problem. I have some "standard template" with a matrixRepeater field on it. (Screenshot1, that red marked part is my matrix) This field has different types ofcourse ... one if its types is "Slider". (Screenshot2) If you click it - the slider type contains a repeater with an Image field and some other fields that looks like this... (Screenshot3) If I change the "Element label" from "#n" to anything else like "#n - {bild.name}" or "bild.title" for example - the page that contains the matrixrepeater does not save the image field anymore. You can upload i picture, save the page, it even tells that it has been saved but its not showing in the backend - its just an empty item with no picture in it. Does anyone have a fix or an idea how for this? PW version is: 3.0.42 FieldtypeReapeaterMatrix is v0.0.3
  11. 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...
  12. 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
  13. 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?
  14. 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!
  15. 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.
  16. 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.
  17. 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> }
  18. After working with PW for quite so time i came to my first issue: After testing around I added pages "part" with few fields and repeater. $p = new Page(); $p->template = 'part'; $p->parent = '/parts/'; $p->name = $pageName; $p->save(); $p->of(false); .... // adding repeater $store = $p->pStores->getNew(); $store->sCount = $sCount; $store->sPartNr = $sName; $store->sPrice = $sPrice; $store->sStore = $pages->get(24464)->id; $store->save(); $p->pStores->add($store); $p->save(); added about 1600 items. Later on I deleted them Using foreach ($pages->get('/parts/')->children as $p){ wire('pages')->delete($p); } Now i can't add any repeater items to new pages I create using code above. It gives me error Can't save page 0: /1473421482-73-1/: It has no parent assigned Now I try to delete repeater field and recreate it. But it says that Can't delete template 'repeater_pStores' because it is used by 1685 pages. But there are no pages. I looked in DB. and found that repeater fields still hold values for pages that does not exists. [EDIT]: found that pages still exist in db. So i deleted them manually. Recreated field but same problem stands. Im not sure in witch step I fcked up, but can someone point fingers at me and tell what i did wrong or why its not working?
  19. 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> } ?>
  20. Hello, I found the following bug: If you have two or more different text fields on a page, which use the same CKEditor-custom-js-style-set and one of these text-fields is located in a repeater-field, the style-set doesn’t work anymore. Has anybody discovered this problem before?
  21. 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
  22. 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);
  23. 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!
  24. 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
  25. 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.
×
×
  • Create New...