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 Guys, I am pretty new to process wire and am experimenting with repeater fields. The issue is that the image cannot be found via the URL but im not sure why? Im sure this is something silly however I cannot see the problem. The image is uploading fine via the content management system however when viewing on screen it comes as though the image cannot be found. All help would be greatly appreciated. Thanks, Melissa <?php foreach($page->about_timeline_left as $about) { $image_left = $about->left_images; echo "<div class='ss-row'> <div class='ss-left'> <img src='{$image_left->url}' alt='{$image_left->description}'><a class='ss-circle ss-circle-1 ss-circle-deco'></a></div> <div class='ss-right'> {$about->right_description} </div> </div>"; } ?>
  2. Hi there, I have a single page website. This single page website has a section that includes posts that have their own content already displayed on the page. What do you recommend, should it be best to maintain the repeater structure or should I make this section based on pages? (you can think of this like a blog, but the content is already within the main page, thus making it a single-page website) Thanks in advance
  3. Hi, i have a problem with the repeaters; i can't delete or modify the item from a repeater; when i delete de repeater field from the page and then add again some of the value have still present. i dont understand this error. what can i do?
  4. Hi, im trying to play with the repeaters; i read the excellent tutorial on this page and made some groups for a project but i have a few questions. Is possible to every item for a repeater (item) be collapsed in the panel admin? Is possible change the title for the row, to know his content without need to click then? Regards.
  5. Hi! I'm currently working on a project that lists chairs. Each chair comes in multiple colors. Each chair has a repeater field with 2 fields: an upload a photo field and a select (which is a Page field) so you can associate the photo with a color from the select. From the Color perspective. Each color has been aplied to a number of chairs, and I want to have a page for the color "Red" and list all red chairs but show the red color image of that chair. So I need to find all chairs which are in red (this gets selected with another field but not inside a repeater). Then inside the loop I look for a repeater instance that has the color red. Everything good till the point I don't know how to find the photo adjacent to the color red. That is, the field in the same line of the repeater. I only need the full row which is the red thumbnail and leave the rest behind, I think I might be over complicating somehow... I'm really lost. Is this the right way? I guess this might be difficult to explain. Let me paste some code and an image for the Chair element with the repeater: $chairs = $pages->find('colores='.$page->name); $i = 0; if($chairs) { foreach($chairs as $chair) { $i++; $additionalClass = ($i % 3) == 0 ? " last" : ""; ?> <div class="item <?php echo $additionalClass ;?>"> <a href="<?php echo $chair->url ;?>"> <?php $chair_color_photos = $chair->producto_color_thumbs; // The repeater field. Contains rows with color names -> thumbnail $color_thumb = ''; // Find the red color name and photo if($chair_color_photos) { foreach ($chair_color_photos as $color_photo) { if($color_photo->producto_color_thumbs_opcion == $page) { // $page is Red $color_thumb = $color_photo->producto_color_thumbs_opcion; } } } if($color_thumb) { // Find the Red photo ?? } elseif($chair->producto_thumb) { echo "<img src='{$chair->producto_thumb->url}' alt='' />"; } echo "<hgroup class='descripcion'>"; echo "<h3>{$chair->title}</h3>"; echo "<h4>{$chair->summary}</h4>"; echo "</hgroup>"; ?> </a> </div><!-- .item --> <?php } }
  6. I've created sections of my page hierarchy to track different attributes, which I then use to populate a Page(Multiple) selector. They aren't displayed on the site; they're used as a kind of categorization method. I use the PageArray selector in many of my repeating fields. Then in the template code I ask for all the items in a particular branch of the hierarchy along with every instance of a repeating field that has been associated with that page via the PageArray selector. It looks like this: <?php if (trim($page->person)) { $cluepeople = $pages->get( "id=1344" ); $peopletypes = $pages->find( "parent=1582, include=hidden, sort=sort" ); foreach ( $peopletypes as $peopletype ) { echo "<h3>" . $peopletype->title . "</h3>"; $peopletypeid = $peopletype->id; settype($peopletypeid, "string"); foreach ( $cluepeople->person as $thisperson ) { $peopleselectorvalue = $thisperson->people_selector; settype($peopleselectorvalue, "string"); if ( $peopletypeid == $peopleselectorvalue ) { echo $thisperson->title; } } } } ?> I'd love a code review to know if this is a clumsy way of doing this and if there is an easier way (there usually is w/PW). Thanks, Jenn
  7. hey community! maybe i'm on the wrong way but here is what i'm trying to do: i have a page called "tickets" with a template "tickets_index" which only renders a list of the page's subpages. the subpages (aka "the tickets") uses the template "ticket" which outputs all the fields of a subpage (aka "a ticket"). one of the ticket-template-fields is a repeater-field called "timesheets". this repeater-field uses the fields: ts_title, ts_desc, ts_starttime, ts_endtime. Here is my code from template "ticket" which should output every set of data from the repeater-field of the ticket... foreach ($page->timesheets as $timesheet_item){ $timesheet_item_list = ' <li class="clr_fx"> <div class="clr"> <div class="col_5"> <p class="clr_fx item title"> <label>Titel</label><span>'. $timesheet_item->ts_title .'</span> </p> <p class="clr_fx item"> <label>Beginn</label>'. $timesheet_item->ts_begin .' </p> <p class="clr_fx item"> <label>Ende</label>'. $timesheet_item->ts_end .' </p> <hr class="alt2"> <p class="clr_fx item calc_diff"> <label>Gesamt</label> <span>'. get_time_difference($timesheet_item->ts_begin, $timesheet_item->ts_end) .'</span> </p> </div> <div class="col_6"> <p class="item desc"> <label>Beschreibung</label> <span>'. $timesheet_item->ts_desc .'</span> </p> </div> </div> </li> ';} $timesheet = '<ol class="list_ticket_timesheet">'. $timesheet_item_list .'</ol>'; $content .= $timesheet; ...but as you can see (check the pictures below, too), it outputs only one set of data from the repeater. i only see the repeater-dataset "test 1". but i wanna see "test 2", too. and maybe more. did i missunderstood the field repeaters logic? - i mean: the sets are visible in edit-mode, so they seem to be somewhere ankered with the page->timesheets (well, as page in admin/repeaters/..., i know). so, what do i have to change to make this working like it should? thanks for your attention and best regards from Saxony/DE.
  8. 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.
  9. Good evening! I did my first attempt with processwire. Everything worked fine. But after defining and inserting a "repeater" into a page i cannot access my site anymore. I only get the "500 Internal Server Error". The debug mode throw this out. Any ideas? Thanks an greetings from germany Martin Fatal error: Exception: Method Page::editable does not exist or is not callable in this context (in xxx/wire/core/Wire.php line 232) #0 [internal function]: Wire->__call('editable', Array) #1 xxx/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module(485): Page->editable('repeat_me') #2 xxx/wire/core/Wire.php(271): FieldtypeRepeater->___wakeupValue(Object(Page), Object(Field), Array) #3 xxx/wire/core/Wire.php(229): Wire->runHooks(Array, Array) #4 [internal function]: Wire->__call('wakeupValue', Array) #5 xxx/wire/core/Page.php(442): FieldtypeRepeater->wakeupValue('wakeupValue', Array) #6 xxx/wire/core/Page.php(1337): Page->setFieldValue(Object(Page), Object(Field), Array) #7 xxx/wire/core/Page.php(130 in xxx/index.php on line 214
  10. 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?
  11. 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.
  12. 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
  13. 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.
  14. 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/
  15. 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.....
  16. 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 ... ...
  17. 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
  18. 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
  19. 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!
  20. 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
  21. 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!
  22. 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!
  23. 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.
  24. 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?
  25. 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
×
×
  • Create New...