Jump to content

jonathanp

Members
  • Posts

    4
  • Joined

  • Last visited

jonathanp's Achievements

Newbie

Newbie (2/6)

2

Reputation

  1. Hi Guys, Just to note I solved this issue, see code below: $deleteme = $data->geonameid; $x = wire('pages')->get("template=userinfo,forkey=$thisuser"); foreach ($x->user_location as $value) { if ($value->location_geonameid == $deleteme) { $x->user_location->remove($value); $x->setOutputFormatting(false); $x->save(); } } I had to loop over each repeater then match the page based on custom id field, then remove. Seems slightly dirty but as the number of repeater fields should not exceed 10, should be sufficient enough. Many thanks
  2. Hi Guys, I'm at a bit of a loss and wondered if some one can help me out. Basically I am trying to use the api to remove a specific repeater field. I have a template called userinfo which holds a repeater field called user_location. user_location repeater field holds a field called location_id. I am trying to find a specific repeater field by its id, and then delete it. However all attempts have resulted in fail, I am using the latest version of Processwire. I have made so many attempts it not really worth my putting any code below, but here was my last try. Many thanks Jonathan $deleteme = $data->geonameid; $thispage = wire('pages')->get("template=userinfo"); $locations = $thispage->find("user_location.location_geonameid=$deleteme"); $thispage->user_location->remove($locations); $page->save();
  3. Thank you very much Adrian, now I understand the number in the url. I am actually using ember.js as a front end and retrieving the data via JSON. But that was a big help Many thanks
  4. Hi I am very very new to Process Wire, I have been playing around with the Web Service Module. However I would like to be able to get the url of the image suppled back through the json data. Currently it just returns the image name ? Is there a way to return this in the JSON data. From the returned data (ajax call) I then create a page layout. Any help or a prod in the right direction would be great. Many thanks
×
×
  • Create New...