Jump to content

Search the Community

Showing results for tags 'Repeaters'.

  • 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 everyone. As per the title, this is the scenario: I have a main page with a FieldtypeRepeater with 4/5 elements added, where each repeater are called in other pages (linked to the respective repeater by the id: so the pages are url based with their repeater items). Accidentally, the repeater items were deleted from repeater field on the main page. (I know what you're thinking... "Accidentally? How is that possible?" ?- But please, trust me ?: I don't know how they are literally "disappeared" from the page...). Actually only the main page has lost someting (a selection based on the deleted repeater ids), but not the other pages. I suppose if I rebuild the deleted items in the main page from scratch, I will create a big mess in the other pages with the old repeaters and the newer ones. And deleting all the other pages to rebuild them with the new repeaters is not an option. I already checked in the admin tree and the repeaters are still in /admin/page/repeaters/for-field-XXX/for-page-XXXX/ Any ideas to "relink" those repeaters to the original main page (of course without losing original ids or recoding php templates and functions)? Is there any "magic" API? Many thanks in advance.?
  2. Hello, I have the following selector and output which works when I am logged in as an admin and as a guest as well. $pages->get("name=reports")->children()->each("report_meta_details.report_type.title") //Output //Array ( [0] => Global [1] => Global [2] => Global [3] => Global [4] => Global ) Now, The following selector returns different results for Admin and Guest: $pages->get("name=reports")->children("report_meta_details.report_type.title=Global")->each("report_meta_details.report_type.title"); //Output for Admin //Array ( [0] => Global [1] => Global [2] => Global [3] => Global [4] => Global ) //Output for Guest //Array ( ) Here, the field "report_meta_details" is a FieldsetPage, the field "report_type" is a page reference (to children of a page called report-type). Now, the first once runs for both the users; and both the users have the access to the templates, as the titles are returned correctly in the first selector. But the second one, the selector is using something that the users have access to but still does not show the results to the Guest. Any reasons why this is the case? All help is appreciated. Thanks! EDIT: I have tried the check_access=0 selector as well. But no effect.
  3. I have a front end form for creating new pages, repeater and repeater matrix field don't seem to save any data. I was considering handling the data manually but can't seem to get anything useful from the post data, are there any methods i can use?
  4. Hi all, I could have sworn I used to be able to use the site generic 'title' field as a sub field of a repeater field. However I've tried to do this on two 3.0.165 sites recently and, while it will add the title field in the repeater field setup, it wont save the repeater title sub field's content when the repeater is used in a page template and edited. It;'s not a big issue but I wondered if this was a known restriction?
  5. 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?
  6. Hello guys, very simple question about repeaters from the Core Modules. I have used them before without issues. This one concerns a weird behaviour which I am not sure whether it's caused by me not using it correctly or a bug. The problem is that when I add content, save it, refresh the page and return to the page, I cannot unfold the repeater. I made a video so you can see the behaviour (below) I tried re-initiating the repeater field, but still doesn't work... Looking forward to your advice! Thanks! repeater-problem.mp4
  7. Hello, and welcome to what I though was either my client being silly and changing things, or some evil doer. Turns out its reproducible and therefore something in Proceswire (I checked my templates and modules but couldnt find anything that would be doing this...). So what is it doing? Check out the video for evidence. A repeater field is interacting with a page template and another repeater field somehow to swap the fields in the template and repeater over... I have a template called team, and a repeater field called team_repeater with label Team. Some how and for some reason, when I change my fields on repeater called main_menu_links my team template gets those fields and when I try and revert the team template fields to the fields it should have, they get given to the repeater main_menu_links. Also this to say HELP!!!!! video: https://www.dropbox.com/s/exkdhc6n7x0xpsa/strange-repeater-PW-mega-bug.mov?dl=0
  8. Hello there, and thanks for ProcessWire! I'm getting to know ProcessWire while doing my first project using it and I really like it so far. The challenge I'm facing right now is the following: I have a One-Pager using fullpage.js, realized as a single PW-Page containing a Repeater Field where each Repeater Item is one Section. Some Sections are supposed to have a little menu at the Top which references/links to different Sections of the Website, so I wanted to use a Checkbox Field "Top Menu" to decide if a Section gets a Menu and a Page Reference Field to choose the different Sections (Repeater Items) it should contain. I've already accomplished this by pasting the following code into /site/ready.php: $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->hasField == 'top_menu_entries') { $page = $event->arguments('page'); if($page instanceof RepeaterPage) $page = $page->getForPage(); $event->return = $page->; } }); The only problem that still remains is that when I select the Entry of the Repeater Item itself it doesnt save the selection, meaning after I saved it's unselected again. On some Sections I do want a Menu-Entry for the Section itself though (which would be styled differently and not link anywhere) for Continuity-Reasons, any ideas on how to achieve that?
  9. 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!
  10. 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.
  11. 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.
  12. 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?
  13. 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.
  14. 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!
  15. 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!
  16. 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?
  17. 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
  18. 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?
  19. 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!
  20. 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?
  21. 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.
  22. 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
  23. 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
  24. 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?
  25. 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>"; } ?>
×
×
  • Create New...