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, 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
  2. 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.
  3. 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?
  4. 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?
  5. 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
  6. 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.
  7. 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.
  8. 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 } } ?>
  9. Hello, I am developing a module that lets a user create, modify and save a "TV Grid" (the schedule for a TV channel). Here you can view some images that illustrate the concept: https://www.google.com/search?q=tv+grid&tbm=isch Of course, those are just examples and do not represent my specific implementation, but with that I hope you get the idea. The module installs a template for a "channel" (among other things). The "channel" has a "Repeater" field, where I store the complete grid for that channel. The repeater (grid) contains repeater items (grid items) that represent a scheduled show, e.g. ["Friends", Monday, 1st show of the day, lasts 60 minutes]. The repeater field is hidden from the user if he/she tries to edit the channel page via the admin's page edition interface. The intended way to edit this TV grid is by using the module's page that I've developed, which provides a custom interface for creating, manipulating and saving the grid. This of course means that I'm doing many things programmatically. The problem is that the repeater items I'm creating via code using the user's input just WON'T save. I've made all the code changes I could think of, trying different stuff, without positive results. Looking at the database, I notice the following when I run my code: - The corresponding row for the repeater field in its table is updated/saved. - However, no new rows are created for the repeater item fields (e.g. TV Show, duration, day, etc.). Would you please help me out here? I'm becoming insane ... I've included some code below. /* * More code before this, ommited because it isn't relevant. */ // Get the channel object (a Page). $channel = wire("pages")->get($channelId); if(!$channel->id) { $this->error("Channel does not exist. Grid can't be processed."); return ""; } // We need to clean this channel's grid before working with it. // "channel" is the Page // "tvChannelGrid" is the Repeater $channel->tvChannelGrid->removeAll(); $channel->tvChannelGrid->save(); $channel->save(); // Save the page.*/ // Add the grid items received from the module's form to the channel's grid. foreach($tvGridData as $i => $item) { // "tvGridData" is an associative array with data received from a form. $showId = intval($item["tv_show_id"]); $duration = intval($item["duration"]); $day = intval($item["col"]); $row = intval($item["row"]); $gridItem = $channel->tvChannelGrid->getNew(); // this must be done according to the documentation. $gridItem->save(); // Save the newly built item. // Assign values to repeater fields. $gridItem->tvChannelGridShow = wire("pages")->get($showId); // FieldtypePage $gridItem->tvChannelGridShowDuration = $duration; // FieldtypeInteger $gridItem->tvChannelGridShowDay = $day; // FieldtypeInteger $gridItem->tvChannelGridShowRow = $row; // FieldtypeInteger $gridItem->save(); // Save the newly built item. $channel->tvChannelGrid->add($gridItem); // Add the new item to the repeater. } $channel->tvChannelGrid->save(); // Save the repeater. $channel->save(); // Save the page.
  10. Hi, Can i make repeater inside repeater? If yes, how to call it? Plz help. Regards Peterpp
  11. Dear friends, i am a newbe but very glad to join the team... My question is ... from a page www.pagename.com/portfolio/1091 i want to echo a repeater's title, images etc. The 1091 is the repeater's id i tried the one below: $repeater_id = filter_var($input->urlSegment(1), FILTER_SANITIZE_NUMBER_INT); $repeater = $fields->get($repeater_id); echo $repeater->title; But Nothing happens. Any idea?
  12. Hallo, for a number of floating flexboxes I want to limit the number of them in each row. This is what I tried : <?php foreach($page->projectBox as $box) { if (count($box)<3 | count($box)>3) { echo "<div class='projektbox'>"; echo "<h2>{$box->boxTitle}</h2>"; echo "{$box->boxText}"; echo"</div>"; } if (count($box)=3) { echo "<br>"; } } ?> Which throws a 500 error... any help, pls? Thank youuu!
  13. Hi, I need a frontend form with an repeater field (single text field with user input). After the form is submitted it will generate a new page, save it and than fill all the additional fields (works fine with images). But during add an item repeater says: Is there another way to build an "repeater field" used in a frontend form? Is there a solution to get it work?
  14. Hi folks, I have a repeater set up on a page and wondered if it's possible to only return the repeater rows that have a certain 'item' selected from a dropdown select field? So, for example, on my dropdown select I have two options 1: Article and 2: Sector guide, and I can return each row of the repeater easily enough with: <?php $articles = $pages->get('/practice/publications/'); ?> <?php foreach ($articles->practice_publication as $article) : ?> <?php echo $article->practice_publication_title; ?> <?php endforeach; ?> But this will of course return all the repeater fields, whereas I need it to only return the fields which have the practice_publication_type=1, for example. I tried looking around for the answer to this but couldn't find anything. Maybe it's not possible... Cheers, R
  15. How can I get the id of a repeater field from another page? I want to do something like if($pages->get(1034)->quotes->id == $i){ echo "Yes"; } Where quotes is the name of the repeater field
  16. It would be great to add limitiations (f.e. output 7 repeats without the possibility to add or to remove a repeat) to the repeater fields (like permanent repeats) This can be used for example for opening hours (output 7 repeats each for one day). The customer has no possibility to delete or add another repeat. The limitations should be placed under the details tab.
  17. Hey I'm stuck with a issue how to filter repeater results depending on content. I have a few Option fields where you can select "yes", "no" or then leave it blank "". I got my loop working and I'm able to skip content that has not been set. Now I just need a filter for the loop. <? foreach($pages->get("/content/")->children as $c): ?> <div> <p> <?php if($c->titles) echo $c->titles; ?> </p> </div> <? endforeach;?> I was able to make a if-statement which checked if($c->Selector=="no"): but as it was in the loop, it kinda bugged out. Never got it working either outside the loop... One really hacky way I thought about was using CSS Classes to set classnames, and that way split what is shown and what is not. This is a really bad way as it still loads all the content for each Selector value. What I'm looking for is eg. a filter that every Selector with value "yes" will be looped, others dismissed. Any ideas how to work on with this?
  18. I have an image and video carousel that I want to use on a page and have it be editable via processwire. The problem is that the code for images and video is completely different. What is the best way to go about making one repeater field where you can pick either a video or image? I thought about having nested repeaters but not sure if that would work. I want it to be possible to order the slides so having them as separate repeaters wouldn't work either. I am a bit stumped. Any help would be great. Images: <div class="rsContent"> <img class="rsImg" src="abc.jpg" alt=""> <div class="infoBlock infoBlockLeftBlack"> <h1>...</h1> <h3>...</h3> <h4>...</h4> <p>....</p> etc etc </div> </div> and for video is this: <div class="rsContent"> <a class="rsImg" href="abc.jpg" data-rsVideo="https://www.youtube.com/"></a> </div> Thanks you
  19. Hi guys, I have literally just installed a new site with processwire. On creating a repeater field I am getting the error: Invalid value sent to Page::setTemplate and as a result can't add any fields to the repeater. I have installed it as normal through modules and have never faced this issue before. Can anyone help please? Thank you, Mel
  20. I'm sorry I cannot give examples and have very little clue what's happening. Did I change a flag months ago? Did I experiment and save something wrong in a config somewhere? I don't know, but this is what's happening: Thousands of pages are created over time (months). They appear to be repeater "ready pages". The pages are of status 3073 (statusOn | statusHidden | statusUnpublished). They are children of legit pages, but invisible, yet dragging every query down to the point of timing PHP out. The template is a repeater field w/ 2 fields in it. There is no data in the field_* tables for these pages; there are only pages rows, lots of them! Using version 2.5.3. To clean is up I do: delete pages WHERE templates_id=245 and status=3073 and the noise goes away. However I have no idea how the noise gets introduced over time... ? There were 9,368 pages the last time I did this. Here's the data for this template. Any hint would be appreciated. thanks. === template row: id : 245 name : repeater_boooking_price (sic) fieldgroups_id : 299 flags : 8 cache_time : 0 data : {"noChildren":1,"noParents":1,"slashUrls":1,"noGlobal":1} === fieldgroups_fields rows: fieldgroups_id : 299 fields_id : 344 sort : 0 fieldgroups_id : 299 fields_id : 337 sort : 1 === fields row: id : 345 type : FieldtypeRepeater name : booking_price flags : 0 name : ----- label : ----- data : {"template_id":245,"parent_id":1585,"repeaterReadyItems":3,"repeaterFields":[344,337]} === pages row: id : 1585 parent_id : 1039 templates_id : 2 name : for-field-345 status : 17 sort : 1 name1258 : status1258 : 0
  21. Hi folks, I am building a 'logo' list of supporters/clients. I have two slides and would like to show different ones on each slide, but work with a single repeater on the page. There is two checkboxes within the repeater when adding a logo ('created_for' and 'helped_create'). I thought this code below would work in returning ONLY those 'repeater rows' which has the 'created_for' checkbox checked, but it's still including the logos that have the 'helped_create' checkbox checked too. I think I may have my foreach loops mixed? Any thoughts? <?php $created_for = $pages->find('wwww_slider.created_for=1'); ?> <div class="each-icon-container"> <?php foreach ($created_for as $created) : ?> <?php foreach ($created->wwww_slider as $icon) : ?> <div class="each-icon"> <?php if ( $icon->link ) : ?><a href="<?php echo $icon->link; ?>"><?php endif; ?><img src="<?php echo $icon->logo_off_state->url; ?>" /><?php if ( $icon->link ) : ?></a><?php endif; ?> </div> <?php endforeach; ?> <?php endforeach; ?> </div> Thanks in advance, R
  22. Title says it all... other image types are saving fine, including cropimages in other (non-repeater) contexts. However the cropimage in the repeater field uploads to 100%, then disappears. Please help!
  23. Hi there, Is there is a built-in way to prevent duplicates when it comes to the Repeater field type? The Repeater I have setup contains two fields: one is a select list of other Pages and the second is just a text field. Ideally, I'd love the select list of Pages to work similarly to how the Fields list in Admin works. As you're adding Fields to a Template, the ones you've already added become disabled in the list so they cannot be added again. If that's not possible, then would something like the following be the next best solution as a module? public function init() { $this->addHookAfter("InputfieldRepeater::processInput", $this, "validateNoDups"); } public function validateNoDups($event){ $field = $event->object; if($field->name == "technical_specs"){ $page = $this->modules->ProcessPageEdit->getPage(); $specs = $page->get("$field->name"); $s = array(); foreach($specs as $spec) { if ($spec->technical_spec) { $s[] = $spec->technical_spec->title; } } $dups = $this->get_duplicates($s); if ($dups) { $field->error("You have duplicate technical specs: " . implode(', ', $dups)); } } } Thanks! Lauren
  24. Hi Guys, I have created a slider using Bootstrap and in Bootstrap the slider image that is first in line is required to have the class active. In creating a repeater for my client to add images, I need to add a conditional statement to check if the item is first in the repeated elements and if it indeed is first, assign active as the class. Not sure what is best practice using a selector and the api to see if the the repeated element is first in the repeater list. Any light? Thanks guys!
  25. Hi, Can someone please help me with the scenario below, I am trying to build a Project portfolio sort of a site. I have a homepage which displays three recent items from a Repeater field named my_items (3 RepeaterReady fields are created for the home page and filled with data), example code below: <?php foreach ($page->my_items as $item) { ?> // display item values, for example: <div class="item"> <img src="<?php echo $item->my_image->url; ?>" /> <a href="<?php echo $item->my_link->name; ?>">View</a> </div> <?php }; ?> I have a page called my-items with repeater 'my_items' field for displaying the same as above. The page 'my-items' has children, each of which have 'my_items' Repeater field for displaying data respective to that page using the same code as above. The page/ site hierarchy is like: Home - uses Repeater 'my_items' |- My Items - uses Repeater 'my_items' |- Item 1 - uses Repeater 'my_items' |- Item 2 - uses Repeater 'my_items' |- Item 3 - uses Repeater 'my_items' |- ... |- My Items 2 |- Item 1 - uses Repeater 'my_items' |- Item 2 - uses Repeater 'my_items' |- Item 3 - uses Repeater 'my_items' |- ... and so on. What I am doing as a starter with PW is: - Entering same data for in Repeater for Home for some item, lets call this 'A'. - Entering the same for My Items the data for 'A' - Entering the same for Item 1 the data for 'A' Therefore, I am adding 'A' thrice in three places, violating the DRY principle. What I have tried and failed is: - To get 'A' to display in My Items page fetched from Item 1 and then, - the Home to display 'A' fetched from My Items so that I only enter data for 'A' in Item 1 and not in every page that displays it. Caveats: - The homepage displays 3 recent only from page My Items - Page My Items displays one from each children - Item 1 has multiple Repeater blocks/ pages for displaying data (e.g. My Item #1, My Item #2, My Item #3 .......... My Item #n) Another way I think to explain it would be a photography site with structure as: Home - display 3 recent photo projects |- Projects - displays each child project with the 1st photo and its description |- Nature - Has many photos with description |- Animals - Has many photos with description |- People - Has many photos with description I hope I had explained properly. Any help or suggestion would be highly appreciated.
×
×
  • Create New...