Jump to content

Search the Community

Showing results for tags 'repeaters'.



More search options

  • 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
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Categories

There are no results to display.


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

Found 25 results

  1. Hi! I have been struggling with this for the last few hours and could not find a solution for it anywhere on the forums. I want to create a repeater field using the API and then add fields to it programatically. I can create the field and assign it to a template alright, but I can't assign any fields to the repeater itself. I've tried using $field->repeaterFields when creating the field but cannot figure out what it's supposed to accept. I tried passing it an array of IDs as well as a fieldgroup, but I couldn't get either to work. Any ideas?
  2. Hi guys, I'm getting crazy trying to figure out what is the cause behind a weird problem is giving me some bad moments with my client. I have a repeater field, with some fields as childre. From one day to the other the children fields of the repeater change and i find other fields as children. Also, all the content my client inserted in that repeaters are gone, cause now we have the new empty children fields. I really don't understand what can be the reasons behind this. This happened more than once. It' s like there is a repeating action that changes the repeater's children. The only repeating action I can think of is the chronjob for the database. Could this depend on that? Have you any idea or suggestion of what should i check or ho to solve this weird problem? Thank you very much!
  3. Hi, Been updating fields on a live site from my dev site to get them in synch and I noticed repeater pages visible in my pagetree on teh live site. What might I have done to have this happen? The repeater module was enabled on both sites.
  4. Hello all, I've been using repeater fields for many purposes. Mostly I use it to store multiple entries of similar kinds of data in a single page. A while ago Ryan answered one of my questions related to repeaters here. That is when I started wondering if I'm misusing the repeaters and probably will have to pay for it later when the site grows. So this question is just to understand the Do's and Don'ts about repeaters. I hope this will be informative for everyone & useful for not so bright people like me. Thank you.
  5. Hi Guys, I have been using Processwire for years now and have mastered enough to create some amazing sites and applications. However, recently I have been thrown a bit of a curveball and hoping some more veteran members can chime in. I recently ran into a weird issue. I had imported about 100+ wordpress pages into a new Processwire site using namespaces. I imported them under a parent page called /landing-pages/. However, I needed to move 20+ of these imported pages to a new parent page called /customers/. Since I was moving so many, I figured batcher was a solid module to run this task. Here are the steps I took: Located all the pages I needed using batcher Changed the pages templates Located the pages again after changing their template Made the pages hidden and then located them again using batcher Changed parent page from /landing-pages/ to /customers/ The issue that occurred is that not only did I change the parent page for these pages but apparently the pages also existed under /admin/repeaters/for-field-whatever which now changed to the new parent of /customers/. for-page-1625 admin /admin/repeaters/for-field-108/ So I reverted this by using batcher again, here are the steps I took: Located all the pages that were not supposed to be moved Changed the pages parent back to /admin/repeaters/ The issue is, after this was done, every time I clicked the new page under /customers/whatever-page I would get a 404. To correct this I had to delete all the pages under /admin/repeaters/ and /admin/repeaters/for-field-whatever and then go back and delete the pages under /Customers/ and create them all from scratch. My questions are: Why did Processwire create pages under /admin/repeaters for the imported pages? The steps I took to correct this issue, is this okay to keep building the site or am I better off starting fresh again?
  6. I am trying to create a sort of database system using ProcessWire. I don't want all the data to show up as pages on the website but instead pull it into pages. Similar to the Skyscrapers demo except in that one the data shows up as pages. The data I wish to store is information about types of moths. So family, sub-family, genus and species. Each of these has information associated with it. For example, species has name, images and distribution. This is another example of information about the species. Initially, I attempted to do this using nested repeaters. This appears to work but I feel there is a better and more elegant way. Additionally, this page says: So I then tried using pages with children, but this also didn't work well. I had to make every single page unpublished as I don't want them showing up in menus and other places. This means they all have strikethroughs in the admin tree which is very annoying. Is there a better way of handling this kind of data in ProcessWire or is this maybe not a suitable project for ProcessWire? I apologise if this is a silly question, but I could not find anything on this matter and am still new to ProcessWire.
  7. Hi everyone, I've upgraded one of my pw 2.7 websites to the 2.8 legacy version and I'm encountering some problems. As you can see in the image I don't see uploaded images thumbnails anymore, and the repeater fields previously added are no more usable. Why I'm having this strange behaviour simply after an upgrade from processwire 2.7 to 2.8? Hope you can help me, I'd like to use the 2.8 version features like the front-end inline editing, but it seems like I'll be locked in the 2.7 version forever Thank you!
  8. Hi everyone! this is my first topic and I need to say thanks to @ryan and all the other contributors for this incredible framework that changed my life as a web dev! But now I go to the point. I developed a project with pw 2.7 and it worked like a charm. Today i'm trying to update the project to pw3 on a local environment, to test that everything will continue working after the upgrade, and that's not the case. The major bug I'm encountering is that repeater field doesn't work properly. Existing Repeater field This is what I see when I try to edit a page that already has a repeater field (Brand concepts) with some elements: If I click on one of the "... blocks" nothing appens. New repeater field If I create a new repeater field and assing it to a template, when I open a page with that template I see the new repeater field, but the "Add new" link, to add a new element, doesn't work. I click it and nothing appens. I never had this kind of strange behaviours in PW, and this is one of the reasons why I consider it the best cms/framework I've ever used. I hope you can help me. Thank you!
  9. For one of my projects, I'm currently building a small events calendar in ProcessWire. One requirement is that an event may have an unlimited number of associated dates. I tried two approaches, however each approach come with a difficulty: 1) One page per event with a repeater that holds the dates. Page: Event 1 Text fields for shared event info Repeater with a date field (e.g. Jan 1, Feb 1, ...) Page: Event 2 Text fields for shared event info Repeater with a date field (e.g. Jan 10, Jan 11., ...) Problem: How can I get a chronological list with all events (dates + shared info) that is sorted like that: Jan 1, Event 1 info Jan 10, Event 2 info Jan 11, Event 2 info Feb 1, Event 1 info ... I know how to access repeaters, however all I got so far is a list structured like that: Event 1 info Jan 1 Feb 1 Event 2 info Jan 10 Jan 11 2) A page with a page reference field from which the backend user shall be able to directly create child pages for each associated date. Problem: What selector string do I need in the page reference setup, to make sure the new page is always created as child of the current page (no matter where that page lives in the backend structure)? Or is this only possible with custom PHP code in ready.php? Would you consider one of those approaches a good strategy? If so, do you have any solution to my problems? If not, is there a better way?
  10. Is there something like that available in PW ? I need to filter something in a repeater by its last value. Something like that: repeater.last.field repeater.first.field
  11. Hi, I have a small module I created that copies across field content from one page to multiple other pages. I just added a repeater field and while it copies across to the other pages it has caused timeout/memory issues with PHP. I think this is because of the multiple fields within the repeater (title, text caption, image) each being copied multiple times. I thought one way to help would be to not copy images across as they're not needed in the other pages. However I'm unable to figure out how to copy a repeater field excluding one field within the repeater itself. This is my current code: // Inline gallery 1 if(count($page->article_inline_gallery_1)) { $translation->of(false); $translation->article_inline_gallery_1->removeAll(); $gallery = $page->article_inline_gallery_1; foreach($gallery as $item) { $translation->article_inline_gallery_1->import($item); $translation->save("article_inline_gallery_1"); } } At the point that each repeater imported as a whole ->import($item) could anyone help to exclude one of the fields within the repeater?
  12. 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!
  13. Greetings I'm new to PW, and think it's fantastic! Never, ever, have I seen such an amazing CMF! Anyways, to my question: I had set some Hanna Code to render a list of page suggestions on the http404 page, which works perfectly. The problem, however, comes in when I use repeaters, which are page instances. The page suggestion renderer has the following: $suggestions = $pages->find('name|title|summary|body%='.$request); I have a page that is named services-industries, and repeaters with the word services in the name. As such, repeaters appear in the suggestion results-list if applicable to the search. How can I exclude/remove those?
  14. Here is a quickie! If you use repeaters for sections on a page (good use for repeaters that) then you may want to use anchors to help navigation. The most obvious thing to use is the "name" of the repeater, because repeaters are actually pages and the name field has no spaces. Ah! But there is a problem with repeaters! They are stored as pages under admin, in your page tree, and if you go and look at one you will see that its "name" looks something like: 1401972317-1689-1 Which is less than useful. The next thing to use is the "title" field, but that has spaces, uppercase and the rest. So, here is a quick and dirty little function that I found on StackExcahnge function seoUrl($string) { //Lower case everything $string = strtolower($string); //Make alphanumeric (removes all other characters) $string = preg_replace("/[^a-z0-9_\s-]/", "", $string); //Clean up multiple dashes or whitespaces $string = preg_replace("/[\s-]+/", " ", $string); //Convert whitespaces and underscore to dash $string = preg_replace("/[\s_]/", "-", $string); return $string; } Now all you have to do is use it in your foreach loop for your repeater: function myRepeater (){ $repeaters = wire("page")->my_repeater; $out = ""; foreach($repeaters as $repeater){ $anchor = seoUrl($repeater->title); $out .="<a name='{$anchor}'><h3>{$repeater->title}</h3></a>"; } echo $out; } And there you have it. Your anchors are now-like-this and your SEO is just that tiny bit better. Note: There is probably a neater way to do this, but this is nice and clear and does everything, I think.
  15. Hi all I've just taken over the codebase for a new site in development that uses ProcessWire, and so far I'm really impressed with it all, and have managed to find solutions to all my problems to date. Thanks so much for everyone who has contributed to the project so far. However - there is a problem that has cropped up with some of our pages and I can't find any mention of it anywhere online. When editing in the CMS, some repeaters get into a state where new edits are no longer saved. So you make an edit, hit save, get the "page has been saved" message, but they are just as they were before. Interestingly though, if you add or delete a new repeater block at the same time as editing any of the repeater blocks, the changes are then saved properly. Similarly if you edit any other normal field on the page, along with one of the previously "unsaveable" repeater fields, the changes are saved properly too. Has anyone seen this problem in the past? We are running a fairly old version of PW (2.2.12), so I'm happy to upgrade if this was a known issue that has been sorted. Thanks s
  16. Good Day. I have created a repeater field on a website that I am building. Three of the fields within the repeater uses page reference fields (I hope that's the correct terminology). Everything works fine, except that I cannot get those three fields to display the Title and not the page IDs. I've tried different syntax, however I cannot seem to get this to work. I used a repeater template (repeater_sd_note.php file), as Ryan had mentioned. This works great. I have included these screenshots, that will hopefully help someone to guide me in the right direction. Screenshot 1 - A portion of what the web display looks like. Screenshot 2 - A portion of what the backend display looks like of the Screenshot 1 web page. Screenshot 3 - The sd_note repeater field contents. Screenshot 4 - The template file used on the web page. Screenshot 5 - A portion of the Zurb Foundation _main.php file that covers the rendering of the repeater. Screenshot 6 - The contents of the repeater_sd_note.php file. I have read quite a few forum articles and website documentation on repeaters, however I didn't find anything that I thought covered this subject. I apologize if a solution to this can be easily found. I worked on this for two days already. Thanks in advance. Using ProcessWire 2.4.1
  17. Hello I have the following code: $houses = $pages->get('/houses/')->children('limit=6'); foreach ($houses as $house) { echo "<li>"; foreach ($house->repeater as $repeater_item) { echo $repeater_item->repeater_field; } echo "$house->title"; echo "<a href='{$house->url}'>"; echo "<h2>{$house->title}</h2>"; echo "<img src='{$house->house_thumbnail->url}' />"; echo "</a>"; echo "</li>"; } The problem is that I can't output the nested foreach(). I get a 'Invalid argument supplied for foreach()' error. Do I have a syntax error?
  18. Hi Guys, I'm back with another question. Figured I would ask for another set of eyes on this one. Basically, the categories are being created if a new gallery is added through the CMS but the images are not showing up. Any help would be great! <?php //newgallery is the name of the field in the CMS whic is a repeater //gallery_title is the name of the field in the CMS which is inside the repeater field for the category title. //images1 is the name of the field in the CMS which is inside the repeater field for the images gallery //THIS IS WHERE THE TITLES ARE BEING DISPLAYED FOR A CERTAIN CATEGORY THE USER MAKES IN THE CMS FOR THE GALLERY foreach($page->newgallery as $new_gallery) { echo " <section class=''> <p class='title' data-section-title><a href='#panel1'>{$new_gallery->gallery_title}</a></p> <div class='content' data-section-content> <ul class='clearing-thumbs' data-clearing>"; //The issue is below!!!!!!!!!! //THIS IS WHERE THE IMAGES ARE SUPPOSED TO DISPLAY FOR A CREATED CATEGORY, UNDER ITS OWN IMAGE GALLERY, WHICH IS ALSO TIED TO THE REPEATER FIELD if (count($page->$new_gallery->images1)) { // randomize some images $images1 = $page->images1->getRandom(100); foreach($images1 as $image1) { $thumbnail1 = $image1->size(118,112); echo "<li><a href='{$image1->url}'><img class='photo' src='{$thumbnail1->url}' style='border:1px #dadada solid;' alt='{$image1->description}' /></a></li> "; } } echo"</ul> </div> </section>"; } ?>
  19. Hi every one!, im having a big problem to figure out how to do this in PW in the front end i have this, a question and answer table for cars models: i do this easy with repeaters, the problem is the question are not standard now and going vary by the page, i test to do this but i see redundancy Labels questions, because when i add a new model i have to write the question and the answer (diplicity ). There is a way to resolve this?, sort of creating a template question or list question select so i can edit o create one from the repeater itself? PD: how can i hack PW to allow me to use nested repeaters in this case i need it Regards
  20. Hi, I know that similar postings have been made, but the discussions and the code therein were way over my head. Here's my problem: I created a website on my local machine that used repeater fields. Everything worked. I transferred it to the dev server online using the Export Site Profile module. Everything worked there, too. Here my memory is a little murky, but I believe that I added some fields to templates that caused pages with repeaters to generate about 1000 new invisible, system-level pages each time they were edited. (This may be what renobird discussed here: <http://processwire.com/talk/topic/3619-updating-repeaters-via-api-without-removeall/>) So I fired up phpMyAdmin and manually deleted all those pages -- and probably some that I needed for the repeaters. I cleared the cache. I turned the Repeater inputfield off and on. But now I can neither delete the existing repeater fields in the admin nor create new ones. I tried importing a sql dump of a repeater field from the original system but that didn't solve the problem either. Can anyone tell me if there's a way to fix this? I really need to use repeater fields for this website. I've built a few sites with PW and feel quite comfortable with it but I haven't plumbed the depths of the API yet and have only the most rudimentary PHP skills. Even so, it's amazing how much I can get done. But, as you see, it's still possible to get stuck when you go beyond your depth. Your patience is much appreciated. Cliff
  21. Hey guys, I am confused: my repeater fields are not saved from the API. Here's the setup: 1. A repeater (named 'faqQA') which contains 2 fields: 'title' and 'body'. 2. A template containing the above repeater. 3. A page that uses that template and has one instance of the repeater. Everything was created in the admin back-end. Repeater values were filled with sample text. (The repeater is supposed to be a FAQ item collection). This is the code I have in my template: $cFaqPage = $page; $cFaqPage->of(false); $faq = $cFaqPage->faqQA; $cFaqPage->faqQA->get(0)->title = '1'; $cFaqPage->faqQA->get(0)->body = '1'; $cFaqPage->save(); echo $cFaqPage->faqQA->get(0)->title; // outputs "1" echo $cFaqPage->faqQA->get(0)->body; // outputs "1" die(); The script is supposed to update the values of the repeater fields with some new values, and to exit. However, when I run it and go the the admin back-end to check the page, I still see the old values in the repeater fields. This is quite sad, and I stripped my code down to basics and it's still not working. Any ideas where to look at? Thanks for your support in advance.
  22. Hi, I am using the basic search template from the processwire install. I havn't been able to return any search results from text contained in repeater fields. I have added the repeater field name and all fields contained inside it to my search template. On processwire.com i have found this post in the comments area by someone: Is there any way around this, or are repeaters left out of search results? thanks Alex
  23. Hello there - So I'm migrating an existing yoga studio site that I built into ProcessWire. I created a template for the "teachers" page, which has teacher bios, that uses repeating fields for each teacher & wraps each one in a section tag: <?php foreach($page->Info_Block as $Info_Block) { ?> <section class="bio"> <? echo "<h2>{$Info_Block->Name}</h2>"; echo "<div><img src='{$Info_Block->Image->eq(0)->url}'>"; echo "<p>{$Info_Block->Information}</p></div> "; }?> </section> I would like to make it so that only the teachers' names show, and then the bio section opens when the name is clicked, which I've done with CSS on the existing site: http://saniyoga.com/teachers.php. But the pure CSS solution uses modified inputs, which doesn't seem like a viable solution here. I've tried adding the script for the JQuery UI accordion to the template in both its original form (the containing div for the above code is "dropdown_cont") $(function() { $( ".dropdown_cont" ).accordion(); }); .... and with a modifier to take the section into account, $(function() { $( ".dropdown_cont" ).accordion( { header: '> section.bio > h2' } ); }); but it doesn't work. Still very new to ProcessWire so would appreciate any suggestions.
  24. In the "search.php" template that comes with the download of PW, this line allows you to search for "title", "body" and "sidebar" fields: $matches = $pages->find("title|body|sidebar~=$q, limit=50"); But how do you search for content inside a repeater field? Thanks.
  25. We encountered a performance problem with a custom search today, finding out that one particular database query lasted seconds. Digging deeper revealed it has to do with repeaters when there are enough of them. The site has pages for companies (about 1500 of them) each of which has repeater items attached. Most of them have one single item, total amount of repeater items being under 2000. This leads to about 3500 extra pages in the tree as a penalty for using repeaters (yes, there would have been other possible approaches as well). So, the amount of pages isn't anything massive. Now, when a find("parent=/companies/, title%=keyword") is executed, the repeater fieldtype catches the use of title field (used in the repeaters as well) and tries to ensure no repeater pages get returned by adding !has_parent=<repeaters-page-id> to the selector string. While this is logically right, the resulting SQL query becomes slow due to the extra join used to filter out repeater pages. With those 1500 + 1500 + 2000 = 5000 pages there are about 9000 rows in the pages_parents table (which is used for implementing has_parent selector). This isn't that much either, but it becomes a problem when there's a join between pages and pages_parents. I'm not saying it wouldn't be possible to optimize the query, but as I'm not certainly skilled enough to do it, I went down another road. And the solution is dead simple - actually it's possible to catch it by just looking at those bolded selector strings above . Ready? Ok, if we're searching for pages whose parent is /companies/ why should pages under /processwire/repeaters/ be explicitly filtered out? There's no way they'll match, so we'll just skip the extra repeater filter. And if you we're actually trying to find pages under /processwire/repeaters/ you didn't want the filter to kick in either (well, don't do that anyways, they're internals). Here's a little diff showing the change I made to fix this thing for us (there's a pull request on the way Ryan): $ git diff diff --git a/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module b/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module index 20bb52c..ab9db28 100644 --- a/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module +++ b/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module @@ -138,6 +138,10 @@ class FieldtypeRepeater extends Fieldtype implements ConfigurableModule { // ensure that the repeaters own queries work since they specify a templates_id if($name == 'templates_id' && in_array($selector->value, $templatesUsedByRepeaters)) $includeAll = true; + // optimization: if parent (or parent_id) is given, there's no need to explicitly exclude repeaters + // TODO: has_parent with values other than parents of repeaters-page could be catched as well + if($name == 'parent' || $name == 'parent_id') $includeAll = true; + if($includeAll) break; } } Another performance issue solved. Not a very common one I think, but still worth a fix. Edit: Ryan, no pull request this time. Didn't manage to do it right. Next time there'll be a branch before any changes, maybe that'll do it.
×
×
  • Create New...