elabx

Members
  • Content count

    353
  • Joined

  • Last visited

  • Days Won

    3

elabx last won the day on December 29 2015

elabx had the most liked content!

Community Reputation

406 Excellent

About elabx

  • Rank
    Sr. Member
  • Birthday 04/12/1988

Profile Information

  • Gender
    Male
  • Location
    Mexico City

Recent Profile Visitors

4,896 profile views
  1. elabx

    FormBuilder does allow this by hooking into it. Check this blog post, it gives a hook reference for FormBuilder. http://processwire.com/blog/posts/formbuilder-v34/ Sounds to me that some hook work could help solve this too.
  2. elabx

    Yes, you have to check if the page you are trying to reference exists, if not, create it through the API. For educational purposes, you can check how InputfieldPage does it. See how it iterates through the titles it receives as input, and makes decisions based on the page already existing or has to make a new one. https://github.com/processwire/processwire/blob/master/wire/modules/Inputfield/InputfieldPage/InputfieldPage.module#L840
  3. Use this to get all the options, iterate on it and just check if the value equals the page field value: $field = $fields->get('countries'); $all_options = $field->type->getOptions($field); Check the documentation for more useful on select options fields: https://processwire.com/api/modules/select-options-fieldtype/#outputting-selected-options-on-a-page
  4. elabx

    You cannot delete the pages directly from javascript, you have to make a call to the server. My recommendation from what I can tell from your module, is to turn the list of checkboxes into an actual form: $out = "<form action='.' method='post'>; Remember to close the form tag and also add a button for submit! Check the boxes, click the submit button an there goes the request to the server. You then check on your execute() method for the comment input like: public function ___execute() { if(count($_POST['comment']){ foreach($_POST['comment'] as $comment){ wire('pages')->delete($comment); } } //rest of the code One difference here from what I read on your code, the wire() function which holds all the PW variables you are used to use on templates. After you delete them, the rest of your logic can stay the same, as it will only find the pages that haven't been deleted.
  5. wireshell new --profile=blank Your new best friend!
  6. elabx

    Quickiest/dirtiest I can think of is adding extra javascript to the admin pages and trigger the click on the tabs: http://soma.urlich.ch/posts/custom-js-in-processwire-admin/
  7. For starters it appear that you would need ImageMagick installed on your server to make the format conversion. If time is an issue, I'd use two fields paired up in repeaters, or pages themselves, so the user can upload the pairing of jpeg and the tiff file. Though I understand making the user convert/upload the image is a pain point You could add a method to the Pagefile class through a hook like this: https://github.com/fbg13/FieldtypeFileS3/blob/master/InputfieldFileS3.module#L21
  8. Try: $rep = $ref->repeater_field->get(1222); It should get the you the repeater item with ID 1222. This is a RepeaterPage which is pretty much a normal Page object. I don't have very clear how you know which repeater item you want to edit and where are you getting the data that is meant to be set on the repeater items. Every repeater field is an array of pages, where you can also use the find/get methods to match pages through selectors. Also, every repeater Item can have it's fields set and saved pretty much the same as normal pages.
  9. elabx

    @Uniteam Anything showing on your logs? Under Setup > Logs.
  10. Sorry, my bad, understood the problem wrong from the beginning. Just tested a similar code on an installation I have. I think this line should fix it i think you where trying to get the value from $f which is just the Field object data. $rdata[$f->name] = $field->get($f->name);
  11. I think you are iterating the repeater items assuming they are like fields, so when you assign $rdata, the array is indexed by the page name (each item being a name), and $f->get($f->name) is trying to get a field, but by using a page ID, maybe that's why it's not getting anything.
  12. $p = $pages->get("/".$pageId."/"); I think with this syntax you might be trying to retrieve a path with the ID, which i don't think will work unless your page name and tree location actually matches the Page ID, try just getting it like this: $p = $pages->get($pageId);
  13. elabx

    Sooo, there is another one now haha Maybe this time it takes off? Link to server
  14. Try setting template_id as an integer: $field->template_id = $templates->get("mm_state")->id
  15. elabx

    Is there a smart wat to go about comparing two selectors to see if they are exactly the same? I want to iterate through a group of pages with selector fields, and compare each field selector string to another one coming in through $input->get eg. "baths>1, template=listing" == "template=listing, baths>1" //should return true. I've seen that this (Selectors:: keyValueStringToArray) static helper just handles "=" operator and discards other selectors with a different operator when converting the selectors to an array. (my objective was to compare both arrays)