Jump to content

Search the Community

Showing results for tags 'repeater'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 170 results

  1. I am looking for the best approach enabling control of the repeater inputfield widths in the PW admin. I would like to drive the width of an individual repeater field (width and float for a more grid like layout) by a field within that repeater. For example, a repeater might have the following fields: title body images grid_width I would like to drive the repeater width in the PW admin by 'grid_width'. So, if the field 'grid_width' had a value of '50' the repeater field would have the following CSS - 'style=width: 50%;' applied to it's containing 'li' element. In this way a visible grid of repeater fields could be built with custom control over the repeater widths. This grid could then be more of a wysiwyg of how the repeater fields would work in the frontend and would be much easier for the client / content manager to predict everything would look.
  2. Hi everybody, I'm trying to use a repeater field to list different articles with a title, a description and an image gallery. This is what I want to achieve: <article class="ed2"> <h3>title</h3> <p> very long description </p> <ol class="thumb-grid group"> <li><a href="#"><img src="assets/temp-img.png" alt="thumbnail" /></a></li> <li><a href="#"><img src="assets/temp-img.png" alt="thumbnail" /></a></li> <li><a href="#"><img src="assets/temp-img.png" alt="thumbnail" /></a></li> <li><a href="#"><img src="assets/temp-img.png" alt="thumbnail" /></a></li> </ol> </article> I'm using this code (just testing if images are ready to use): <?php foreach($page->evento as $event){ echo "<article class='ed2'>"; echo "<h3>{$event->titolo_evento}</h3>"; echo "{$event->descrizione_evento}"; echo "<ol class='thumb-grid group'>"; echo "{$event->img_evento}"; echo "</ol>"; echo "</article>"; } ?> my output is this: <ol class='thumb-grid group'>020.jpg|175-0.jpg|ox.jpg</ol> So I Know all the images I uploaded are in place, but how do I loop inside the "img_evento" field to echo different urls?
  3. Was just wondering if anyone had any experience adding repeater items to a new page from a front-end form? The repeater consists of two fields, one a page field and the other a simple text value. I'm unsure how I'd go about adding those values on a new page save()? Thanks, as always.
  4. Hi, I have a number of pages with a template that has a repeater field (salida_fecha_repeater) which has 2 fields salida_fecha (type date) and salida_fecha_markup (float), when I show the pages, I have show the first available date, so I would not show dates before today. $salidas = $pages->get("/salida/")->children("limit=5,salida_fecha_repeater.salida_fecha>=".date("Y-m-d")); foreach($salidas AS $salida ) { $markup = $salida->salida_fecha_repeater->find("salida_fecha>=".date("Y-m-d"))->first(); # Test 1 #$markup = $salida->salida_fecha_repeater->first(); # Test 2 echo $salida->title." [".$salida->id."]"." | ".$markup->salida_fecha_markup."<br>"; } With # Test 1 returns nothing With # Test 2 returns the first record in the repeater does not always correspond. Thanks in advance Diego
  5. I think it would be nice to add an option (e.g. a simple checkbox) to the settings page of the repeater FieldType for adding a new item from the top, not from the bottom (and consequently also reverse the order of the items). So instead of repeater item #1 repeater item #2 repeater item #3 repeater item #4 (here appears a new item) + Add Item it would look like this + Add Item (here appears a new item) repeater item #4 repeater item #3 repeater item #2 repeater item #1 Especially useful when having lots of repeater items. Does that sound reasonable to you? Is it already intended to add the option? Thanks.
  6. One thing i cant seem to find is how to add custom blocks to pages. I.e. I've got a template which includes several content fields - headline, content1, content2 but i also want to add another teaser... it would be great adding "new field" -> teaser into pages where i want to add them to. is something like this possible,without creating a new template for everypage? The ACF plugin for wordpress includes options like this and its very convenient. http://www.advancedcustomfields.com/add-ons/flexible-content-field/
  7. Hi, I was hoping to just get some advice on whether the method we're proposing for building certain site pages is the correct one when using Processwire. I've attached an image which gives an overview of the idea, i'll explain a bit further below: We're building site pages which are broken down into multiple sections. These sections can be 3 different heights, have 3 base layouts for the positioning of content, can accept 4+ different types of user generated (page specific) content, alongside an override which would place a reusable block with its own template in a position. If that's not clear hopefully the image helps.... I am proposing the use of a repeater field to handle the content and placement for each section. This is where I am looking for either a thumbs up or a hell no...... I propose we create fieldsets within the repeater each of which handles 1 of the 4+ types of page specific content (video block, text block, link block etc...). We would then have a page field which can pull in our reusable page templates (offers, USP's etc...). These are all stored in pages which are not customisable from this repeater, therefore they would just place their pages content into the page. Now to get all this working I would have all of the above, 4+ page specific blocks & the reusable pages, within a single repeater, which in turn could then be added to the page x number of times. Obviously this would look like s#it, and be a UI knightmare, so I would hook up another field at the start of the repeater which displayed 5 buttons, 1 per section type available. All 5 section types are then hidden by default (jQuery) and only upon selecting a button can you enter content (jQuery). Furthermore if these buttons are built from a single input then the value can be passed to the pages template and it'll know which of the sections to render. Hopefully this should remove issues like the users clicking all 5 buttons and entering content. I'm a little concerned as to the size of this repeater as every repitition would be generating all the fields, even if the user can't see them. Other than that creating alot of excess blank data fields I believe this should work fine. Being new to pw though I thought I'd push it out there so someone can tell me about the plugin I can download and save myself from typing such a long winded post ever again.....
  8. Hi, I'm struggling with the syntax... multiple galleries, created as repeaters, need an ID to export to JS - to call a gallery script. Everything works so far except the repeater Id, which I don't know how to concatenate to form the #galleryId. This is my hopeless attempt: $repeaterId = $pages->get($repeaterPageID); $galleryId = gallery.$repeaterId; echo "<div id='$galleryId'>"; foreach ... ...
  9. Hi continued working on my testpage. Now created tables with the help of the repeater module. So far no problem. Got all, what I expected. Create needed fields, create repeater, include fields in repeater. Then I created a template repeater_namexx.php. My first construct was (call in page template): <?php foreach($page->namexx as $beilage) { echo $beilage->render(); } ?> my template 'repeater_namexx.php' looks like this: <?php echo "<tr><td>{$page->beilage_menu}</td>"; echo "<td>{$page->woche_menu}</td>"; echo "<td>{$page->woche_preis}</td></tr>"; ?> But what confused me: the repeater_ template ist not visible in the admín template area?? Then I worked on and changed the call in the page template: <?php foreach($page->beilagen as $beilage) { echo "<tr><td>{$beilage->beilage_menu}</td>"; echo "<td>{$beilage->woche_menu}</td>"; echo "<td>{$beilage->woche_preis}</td></tr>"; } ?> so I can call this snippet with a simple include into the page. Also I deleted the repeater_template.php. All running fine so far. But under the admin - repeaters - name... settings I can still see/choose the repeater_name.. templates? Also I always have 3 unpublished empty entrys. After deleting them, they always return to stay. Could someone explain all this behaviours? Did I mixed up something in working order? thanks in advance
  10. Hi! I've just started developing my first PW project (it's great so far! ) and ran into an issue about how to output an thumbnail image: I want to iterate over news items which have an images repeater (field type "image", inputfield type "image") and display resized images: foreach($page->children as $news_item) { ... if (count($news_item->image_repeater)>0) { foreach ($news_item->image_repeater as $image) { <?= $image->width(250)->url; ?> <img src="<?= $image->width(250)->url; ?>" width="250" alt="" title="<?= $image->description ?>" /> } } } I get an $image returns an ID. The "image" fieldtype has the setting maximum files allowed = 1 (0 didn't work too). PW Version 2.2.13. Any idea? Thx
  11. I want to resize an image that is included in a selected featured project as referenced from a Home page. The "Featured Project" field found on the Home page is using a Page type. The "Images" field included in the "Featured Project" is a repeater field that includes an Image field. How do I access the first image in the "Images" field and also resize the image? This works and returns the ID of the image: $img = $page->featured_project->images->first(); but this doesn't work to resize the image: $img = $page->featured_project->images->first(); $thumbnail = $img->size(236,225); Nor does this: $img = $page->featured_project->images->first()->size(236,225); Any insight is appreciated!
  12. Hello, I'm just moving a site to a production server and deleted all my pages via the API. Now I try to re-import the pages again via a script but I get the error 'Can't save page: It has no parent assigned' when trying to add the repeater fields. I don't know what went wrong and how and where a parent for a repeater is assigned. Can anyone help? Thanks, thomas
  13. So I tried using $page->repeater->getRandom() in some template code but it didn't seem to work. Should this work? If not, what is the recommended way of working with a single, randomly-chosen repeater item? Thanks!
  14. Hello, I'm back again with my beginner issues... This time, I'd like to update a field found in a repeater across multiple pages. My code : $found = $pages->find("parent=/invitations/$user->name, guests.guest_name=".$form['oldname']); foreach ($found as $f) { foreach ($f->guests as $g) { if ($g->guest_name == $form['oldname']) { $f->of(false); $out .= '/01:'.$g->guest_name; // THIS IS TO CHECK IF IT WORKS $g->guest_name = $form['name']; $out .= '/02:'.$g->guest_name; // CHANGE APPARENTLY OCCURRED $f->save(); // BUT NEVER SAVES??? } } } Let me try to explain a little : the name of a 'guest' is modified on the front-end. I want to adjust all 'invitations' under the '$user->name' branch (that's how I organized my pages, maybe it's not the best solution...) where the 'oldname' was found (in a 'guests' repeater having 'guest_name' text fields). So I look for the pages and I try to loop each page to check which field has the 'oldname' and when I find it, I change it to the 'newname' ($form['name']) and try to save this change... I have tried many things, but this never worked ! Although I did the same stuff to delete a field (If I remove the guest) and it worked! I just don't understand, so if someone could give me a hand, I'd greatly appreciate... Thanks!
  15. Hi guys, am having a problem with uploading images within a repeater field. I'm just getting a little image icon and the fields aren't getting populated. I'm using the latest dev branch, so not sure if it's a possible issue with that. Can anyone else replicate this? I have included a screenshot. Thanks!
  16. Hi there, I've been struggling for a couple of hours with something I guess one of you will find an answer rather quickly... Let me explain : I'm creating a list of checkboxes according to the number of 'guests' pages belonging to the logged in user. In my page, I'd like some of the checkboxes checked by default IF the logged in user has already recorded them as checked (and this state is saved in a repeater field named 'guests', having 'guest_name' as text input. My code is the following : // If user has guests, list them for easy multiple selection $guests = $pages->find("parent=/guests/, created_users_id=".$user->id); $sel = 0; if ( $guests->count() > 0 ) { $sel = 1; foreach ($guests as $guest) { foreach ($page->guests as $g) { // THIS IS A TEST TO SEE IF I CAN REACH THE REPEATER $out .= $g->guest_name; // IT WORKS AS EXPECTED } //$found = $page->matches("guests.guest_name=".$guest->title); // THIS DOESN'T WORK. WHY? if ( $found) { $checked = 'checked'; } else { $checked = ''; } $out .= '<label for="cb'.$guest->id.'"><input type="checkbox" name="friends[]" value="'. $guest->title .'" id="cb'.$guest->id.'" '. $checked .' />'.$guest->title.'</label>'; } } I've tried many different things : $page->is(), $pages->find(), tried to use has(), but I was incapable of making this work... I have a feeling the answer shouldn't be that hard, but as I said, I've been looking for it for a couple of hours now and I wish someone could give me a hand (again...) on that one. I hope I was clear enough in explaining the issue. Thanks in advance.
  17. In a template, I'm drawing a 4x3 table that I want to display images from other pages selected from page fields inside a repeater on this page. Their position relative to each other is important, and most of the space in the table will usually be intentionally empty, which is why I'm doing it in this rather strange way: In the admin, the referenced page's image's position in the table is chosen from page selects with columns and rows defined in /global/matrix/rows/ and /global/matrix/cols/. In the template, we get the images by iterating through the table and seeing if any of the "ingredient" items on this page match the the coordinates of the current table cell. If what I've described here sounds confusing, it's confusing me, too. Here's my loop: foreach ($pages->get("/global/matrix/rows/")->children as $row) { echo '<tr>'; foreach ($pages->get("/global/matrix/cols/")->children as $col) { $tdobject = $page->ingredients->find("m_row=$row, m_col=$col")->first()->ingredient; echo '<td><img src="'. $tdobject->icon->size(40, 40)->url . '"/></td>'; // line that throws the error } echo '</tr>'; } This gets me: Error Call to a member function size() on a non-object However, changing that line to this works: echo '<td><img src="'. $tdobject->icon->url . '"/></td>'; So I can pull a URL from the image object on the referenced page, but I can't call size() on it. What am I missing?
  18. Hi there, Wonder whether someone can explain something I'm seeing. I started out with an image field type - no repeater. I could access an individual image object reference, point to it's "url" property and I had a path to the image. When the image field is in the repeater, I see the following value: $repeater->images->url = /ProcessWire/site/assets/files/1009/ When I look in this folder, I see the image that I want, and also, another image that in this case is called "gina-bg-2.0x100.jpg" - the one I actually added was "gina-bg-2.jpg". So, firstly, I don't know where the x100 version of the image has come from? Secondly, I want to get the full url path to gina-bg-2.jpg but I cannot seem to see a way of directly referencing it now the image is inside the repeater? $repeater->images is a "Pageimages" type reference. How can I access each contained Pageimage? If I specify $image->images[0], I get a "Page" type and not the Pageimage that I expect. Any ideas appreciated! Thanks --Gary
  19. Hi everyone, I am sorry if this question is somewhere in the forums already, but I've passed my last hour searching for it's answer and I couldn't find it. The problem is the following: I have a Checkbox Page Field inside a Repeater Field. Basically, what I need is to get the title of the selected page(s) in that item. I've tried the following: <?php foreach($page->banners as $banner) { // cycles through repeater items var_dump($page->pagefield->title); What can I do?
  20. Sorry to ask a lame question but after trying I've failed to work out the code I need to do something that I am sure must be easy to do with PW but my newb status and PHP/jQ weakness have foiled me :/ I'm using pages to make a 'select' as described here. I'm using a repeater to add two fields to the editor, one a select and the other a textarea. For my template, in my awful pseudo code I want to do this: if segment_width is set { if segment_width = half then output "grid_6" (to fill in a CSS class) if segment_width = third then output grid_4 - - - " - - - if segment_width = quarter then output grid_3 - - - " - - - output the segment field that follows on from the segment_width/is within the same repeater as the segment_width } I assume I will want a foreach or other loop as these repeater panels will be added in pairs or threes or fours and there may be more than one set, e.g.: segment_width (half) segment_width (half) segment_width (third) segment_width (third) segment_width (third) THANK YOU if you're able to point me in the right direction. Cheers, -Alan EDIT: My other post explains what I am trying to do a bit better
  • Create New...