SoccerGuy3

Members
  • Content count

    30
  • Joined

  • Last visited

Community Reputation

5 Neutral

About SoccerGuy3

  • Rank
    Jr. Member

Recent Profile Visitors

978 profile views
  1. GOT IT!! See the commented out "save" on the fourth to last line of code. That was the ticket. // Parse the CSV data $handle = fopen('data/inventorylist.csv', 'r') or die('Cannot open file.'); $prevportname = ''; while(($row = fgetcsv($handle)) !== false) { list($port_name, $port_num, $plate_num, $plate_name, $year, $price) = $row; // Get the portfolio name for this $group_name $group_item = $page->portfolio_repeater->get("port_num=$port_num"); // If no such item exists, create one if(!$group_item) { $group_item = $page->portfolio_repeater->getNewItem(); $group_item->text = $port_name; $group_item->port_num = $port_num; $group_item->save(); $page->portfolio_repeater->add($group_item); } // Create a photo item for this row $photo_item = $group_item->print_info->getNewItem(); $photo_item->title = $plate_name; $photo_item->port_name = $port_name; $photo_item->port_num = $port_num; $photo_item->plate_num = $plate_num; $photo_item->print_year = $year; $photo_item->print_price = $price; // $photo_item->save(); $group_item->print_info->add($photo_item); $group_item->save(); }
  2. Making some progress on this. Two issues: 1) It only runs through the loop once and then errors: Error: Uncaught Error: Call to a member function getNewItem() on null in /Library/WebServer/Documents/edwardscurtis/_site/site/templates/page-portfolio-import.php:27 Stack trace: #0 /Library/WebServer/Documents/edwardscurtis/_site/wire/core/TemplateFile.php(287): require() #1 /Library/WebServer/Documents/edwardscurtis/_site/wire/core/Wire.php(380): ProcessWire\TemplateFile->___render() #2 /Library/WebServer/Documents/edwardscurtis/_site/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___render', Array) #3 /Library/WebServer/Documents/edwardscurtis/_site/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #4 /Library/WebServer/Documents/edwardscurtis/_site/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array) #5 /Library/WebServer/Documents/edwardscurtis/_site/wire/core/Wire.php(383): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #6 /Library/WebServer/Documents/edwardscurtis/_site/wire/core/WireHooks.p (line 27 of /Library/WebServer/Documents/edwardscurtis/_site/site/templates/page-portfolio-import.php) 2) If I put in the ->save commands in your original code, then I get this error: Error: Exception: Can’t save page 10368: /prints/large-prints/: Call $page->of(false); before getting/setting values that will be modified and saved. [portfolio_repeater] (in /Library/WebServer/Documents/edwardscurtis/_site/wire/core/PagesEditor.php line 515) #0 /Library/WebServer/Documents/edwardscurtis/_site/wire/core/Pages.php(411): ProcessWire\PagesEditor->save(Object(ProcessWire\Page), Array) #1 /Library/WebServer/Documents/edwardscurtis/_site/wire/core/Wire.php(386): ProcessWire\Pages->___save(Object(ProcessWire\Page), Array) #2 /Library/WebServer/Documents/edwardscurtis/_site/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___save', Array) #3 /Library/WebServer/Documents/edwardscurtis/_site/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pages), 'save', Array) #4 /Library/WebServer/Documents/edwardscurtis/_site/wire/core/Page.php(2409): ProcessWire\Wire->__call('save', Array) #5 /Library/WebServer/Documents/edwardscurtis/_site/site/templates/page-portfolio-import.ph Here's my current code, what am I missing? // Parse the CSV data $handle = fopen('data/inventorylist.csv', 'r') or die('Cannot open file.'); $prevportname = ''; while(($row = fgetcsv($handle)) !== false) { list($port_name, $port_num, $plate_num, $plate_name, $year, $price) = $row; // Get the portfolio name for this $group_name /* @var RepeaterPage $group_item */ $group_item = $page->portfolio_repeater->get("text=$port_name"); // If no such item exists, create one if($prevportname != $port_name) { $group_item = $page->portfolio_repeater->getNewItem(); $group_item->text = $port_name; $group_item->save(); $page->portfolio_repeater->add($group_item); $page->save(); } // Create a photo item for this row /* @var RepeaterPage $photo_item */ $photo_item = $group_item->print_info->getNewItem(); $photo_item->title = $plate_name; $photo_item->port_name = $port_name; $photo_item->port_num = $port_num; $photo_item->plate_num = $plate_num; $photo_item->print_year = $year; $photo_item->print_price = $price; // If there are more columns deal with them here $photo_item->save(); $group_item->print_info->add($photo_item); $group_item->save(); $prevportname = $port_name; }
  3. Beautiful!! I think that this is the bit that I couldn't wrap my mind around: $group_item->photos->add($photo_item); Thanks Robin!
  4. I am trying to import data to a repeating field. Searching these forums have lead me to various solutions and I think I have a decent grasp of that aspect of what I need to do. Where I am stuck is that the repeater I am importing into is actually a repeater WITHIN another repeater on a page. Looking for some help or direction to get me unstuck. Here's a sample of what I am working with (simplified): Large Images (page) Group Name (Repeater) Photo (Repeater) Image (um, image field) Image Name (text) Price (text) Data looks like (one row): Group, image name, price So the big question is how to create the outer repeater and then the sub-repeaters. Can it be done? I could manually create the outer repeaters (there are only like 10-15 of them) if that makes it easier, but then, how to address the repeater inside for the import? Any suggestions (or code samples) welcome. Thanks in advance, Marc
  5. Update: Appears to be browser specific. Mac Chrome: Grid only, no details Mac FF: Everything prints.
  6. My client wants to print the page with the Calendar Grid. When you print, the grid prints, but not the individual items. Anyone run across this?
  7. @joshuag - Sent you a PM followup to the open issue and an additional question...
  8. SoccerGuy3

    @adrian - Tried the refresh. Tried changing permissions and ownership at the command line for the site on the local machine. Nothing works. Frustrating, but moving on. It works on the server that's all that matters (at least for now - hopefully won't break when I move it to the live server!).
  9. SoccerGuy3

    @adrian - Thank you for your offer to help.... You know there are days I really like programming, then there are other days! This is one of those others. I moved the site from my local machine to our dev server so I could give you access. Guess what? When I did that the extra fields for language URL showed up!! Thanks again. Looks like we are all good now.
  10. SoccerGuy3

    @adrian Here's what I have installed:
  11. SoccerGuy3

    @AndZyk and @adrian thanks for getting back to me. Yes to both your questions. I have added a second language, Spanish, and can see the option in Admin to switch between Default and Spanish. I have even tested this and see the entire admin in Spanish. I can see the alternate language fields in the individual pages in the admin (actually have already populated them). The one piece that I am missing is the ability to switch languages in the front end. The docs say there should be a place to enter the second language URL piece (see screenshot attached): http://domain.com/es/ I cannot find that. It appears that it didn't get installed or isn't working as the docs say it should. Or I am looking in the wrong spot.
  12. Running the latest PW install. Installed all 4 Language modules and the language pack for Spanish. I can change my default language and see all the labels in the admin change to spanish. But when I go to ANY page in the tree, I see only a single URL field (default). I do not see the additional field to enter the "/es/" into. From the docs (what I don't see): Any suggestions on where to look?
  13. No. Tried: template, original, rrule, month. All with the same result, that is nothing was output.
  14. I tried that: $event = $recurme->event($page); echo $event->orig_date . 'x'; But all that outputs to the screen is the "X". I "solved" it temporarily with: $dates = $page->getDates(); foreach($dates as $key=>$date){ $evDate = date('F j, Y \a\t g:i A', $date); } Which isn't going to work I suspect long term.
  15. Answer was actually in the FAQ! Ajax is not working. Please make sure that your site contains a hidden page home/recurme-ajax/ using the template "recurme-ajax" and that you have a matching file in your site/templates/ folder. IF for some reason this file is missing, you can copy the template file from the InputfieldRecur/templates/recurme-ajax.php.