Jump to content

elabx

Members
  • Posts

    1,358
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by elabx

  1. Well now it does perfectly! But I don't know how I got yesterday to a bunch of 404 pages. If I come accross the situation again I'll let you know.
  2. Hi! @Mike Rockett the documentation pages for Jumplinks seem to be down, will you upload them somewhere else again?? Then again, thanks for this awesome module. EDIT: Whoops, right here: https://jumplinks.rockett.pw/
  3. Sounds to me like a good option is the RuntimeMarkup module, so you can basically render whatever you want in the inputfield, and add the necessary javascript to do the whole copy-paste to clipboard.
  4. So you didn't integrate the shop into the PW website in the end? (I remember you were looking for a solution). What stopped you from doing it? Just curious here ? Great work!
  5. Anything on the error log on site/assets/logs/error.txt?
  6. That looks like some hipster god stack haha
  7. Hi August! I had a bit of a hard time understanding your post, but I think you are trying to get pages with has a page field filled, then, assuming your field is called group: $selection = $pages->find("group!=''"); It's very rare to use SQL statements in ProcessWire unless you are thriving for extreme optimizations.
  8. Hook it in your in the inputfield's render's method: $this->addHookAfter('InputfieldText::render', $this, 'addButton'); In the addButton method, check for the field's name, so it doesn't render everywhere.
  9. For this to happen you must be using somewhere the $user variable which is the one that refers to the user in session. I'm thinking this is what you are looking for, so when Bob is logged in, $user will refer to Bob, and when Amy is logged in, it will refer to her user: $current = $pages->find("template=secondary, page_author=$user");
  10. 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.
  11. 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
  12. 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
  13. 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.
  14. 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/
  15. 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
  16. 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.
  17. @Uniteam Anything showing on your logs? Under Setup > Logs.
  18. 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);
  19. 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.
  20. $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);
  21. Sooo, there is another one now haha Maybe this time it takes off? Link to server
  22. Try setting template_id as an integer: $field->template_id = $templates->get("mm_state")->id
×
×
  • Create New...