Jump to content

Mackski

Members
  • Content Count

    136
  • Joined

  • Last visited

Everything posted by Mackski

  1. You're right, It just wasn't obvious at the time, now that I create another menu it's fine, i must have been smoking something.. 🚬🍀 Thanks for this great module!!
  2. Using this module for the first time, menu created and saved but does not render. Looks like by default it's saved as un-published. I was expecting to find publish settings as part of the menu settings, however the only way to publish it is via the page tree: Admin > Setup > Menu Builder > *Menu* Is this intentional? I think from a usability perspective being able to publish the menu as you create it would be helpful. The only way I could get menu builder to render items was update line 218, MarkupMenuBuilder to: For some unknown reason, PW doesnt skip language. // skip inactive language page @note: PW will do this automatically for 'include_children' if(!$p->viewable($language) && $language) continue;
  3. How do I get a reference to the repeater page, instead of the page the repeater is on? $page->id returns the parent or containing page, rather than the repeater id. [SOLVED] $value = $this->hasPage->data['some_field'];
  4. I have a strange problem with repeaters, the markup for sort order is rendered correctly, as is the repeater list and markup: eg: <input id="sort_repeater73338" class="InputfieldRepeaterSort" name="sort_repeater73338" value="0" type="hidden"> <input id="sort_repeater73322" class="InputfieldRepeaterSort" name="sort_repeater73322" value="1" type="hidden"> After saving, there is no change in the sort order in the DB. Every repeater with the same parent has the same sort order, no matter what. This happens at the time of created via the API, I am explicitly setting the sort order here: $rep = $p->draw_nomination_repeater->getNew(); $rep->page_link = $array['id']; $rep->sort = $x++; $p->draw_nomination_repeater->add($rep); $p->of(false); $p->save(); Could the sort change not be detected when creating multiple repeaters via the API? if($page->isChanged('sort')) { // $this->message("Sort changed for field {$this->field} page {$page->id}", Notice::debug); $sortChanged = true; }
  5. Thanks for your help @Zeka I managed to get both hooks working after a bit of debugging. $this->addHookAfter("ProcessField::buildEditFormBasics", function(HookEvent $event) { $f = $event->object->getField(); if($f->hasFieldtype !== false) { $field = wire('modules')->get('InputfieldTextarea'); $field->attr('name', 'helpTipContent'); $field->attr('value', $f->helpTipContent); $field->collapsed = $f->helpTipContent ? false : true; $field->label = __('Help tip content'); $field->description = __('Enter the help tip content that will appear in the tool tip.'); $event->return->append($field); } }); // inject our markup fields into the form right after the source elements $this->addHookAfter('ProcessPageEdit::buildForm', function($event) { $form = $event->return; $page = $this->process->getPage(); foreach($form->fields as $f) { $content = $f->helpTipContent; if($content) { $_field = $form->get($f->name); if($_field->id) { // add hidden field with tooltip content $field = wire('modules')->get('InputfieldMarkup'); $field->attr('name', 'toolTipContent'); $field->attr('value', $content); $field->skipLabel = true; $form->insertAfter($field, $_field); } } } });
  6. I've modified the hooks to add the field to every inputField. // first hook to add field (works as expected) $this->addHookAfter("ProcessField::buildEditFormBasics", function(HookEvent $event) { $f = $event->object->getField(); if($f->hasFieldtype !== false) { $field = wire('modules')->get('InputfieldTextarea'); $field->attr('name', 'helpTipContent'); $field->attr('value', $f->helpTipContent); $field->collapsed = $f->helpTipContent ? false : true; $field->label = __('Help tip content'); $field->description = __('Enter the help tip content that will appear in the tool tip.'); $event->return->append($field); } }); // second hook to render $this->addHookBefore("Inputfield::renderReadyHook", function($event) I still cant find the helpTipContent field in the second method, maybe I'm hooking into the wrong place?
  7. @ZekaDefiantly not working for me, im stumped now.
  8. Thanks Zeka, my next issue is I've created a custom textarea against a field, and value is saved, but I cannot return the value at render time. I've been modeling a bit of code from: https://processwire.com/talk/topic/9857-page-field-edit-links/ I cannot seem to replicate the rendering of saved values, here is my code: // this works, and saves values against a custom field $this->addHookAfter("InputfieldPage::getConfigInputfields", function($event) { $f = $event->object; if($f->hasFieldtype !== false) { $field = wire('modules')->get('InputfieldTextarea'); $field->attr('name', 'helpTipContent'); $field->attr('value', $f->helpTipContent); $field->collapsed = $f->helpTipContent ? false : true; $field->label = __('Help tip content'); $field->description = __('Enter the help tip content that will appear in the tool tip.'); $event->return->append($field); } }); // at render time $this->addHookAfter("InputfieldPage::renderReadyHook", function($event) { $object = $event->object; d($object); }); // $object does not include my new field, helpTipContent.
  9. Struggling with this, trying to obtain a list of fields under a specific tab in admin. $this->addHookAfter("ProcessPageEdit::buildForm", $this, 'hookField'); public function hookField(HookEvent $event) { $form = $event->return; $fieldset = $form->find("id=ProcessPageEditContent"); $fields = $fieldset->fields; foreach($fields as $f) { echo $f->name.'<BR>'; } } This only outputs all fields from all templates, not the fields from the specific page & table I'm editing.
  10. If I'm adding a custom field I also take it that I'll need to create a schema etc to store the values? Is there a way to adding abitry fields to a page in admin similar to notes, description fields without defining a schema?
  11. Thanks Benhard for this module, small modification i've updated the save() function to allow various output types as stated: https://mpdf.github.io/reference/mpdf-functions/output.html /* ########## output ########## */ /** * save output to: local file ($dest = "FILE") download ($dest = "DOWNLOAD") inline to browser (default - $dest = "INLINE") */ public function save($filename = 'output.pdf', $dest = "INLINE") { if(!$filename) $filename = 'output.pdf'; if($dest == "FILE") $filename = $this->getAbsolute($filename); // save to disk $this->mpdf->Output($filename, constant('\Mpdf\Output\Destination::'.$dest)); } // stream to browser $pdf->save(); $pdf->save('filename.pdf') $pdf->save('filename.pdf,'INLINE); // force download $pdf->save('myfile.pdf','DOWNLOAD'); // save locally $pdf->save('myfileserver.pdf','FILE');
  12. I have a custom admin page & process setup, i want to display an edit page from the page tree.The template contains a PageTable to manage child entries.How would i render this as a stand alone page within my custom process?
  13. In addition to this, I have repeaters with a page field reference. And only 1 in the repeater array does not provide a valid ID. This is super weird, because it's always worked until now. eg: for($page->dad_repeater as $r) { $ref = $r->child_page_ref; if(!$ref->id) die("Error, invalid page reference for repeater ".$r->id); } My code dies on this error, with a valid repeater id. When I check that repeater ID in Processwire, it has valid child_page_ref. Why will the child_page_ref->id return null when the child_page_ref is published, and selected in PW. * FIXED * Underlying code was setting the ID to -1 😕
  14. repeater->sort is returned with duplicate values for multiple entries, not sure how this can even happen. Has anyone experienced this before? I now have to set an index++ while looping though my repeater to set the sort order
  15. I've enabled $config->debug = true; however $database->getQueryLog() returns an empty array. Does this need to be supported by mysql settings in any way?
  16. 100% not working. I've tried a normal textarea field, same result, on save ALL HTML is stripped out. ProcessWire 2.8.62
  17. <br> or <br /> This doesnt seem to be reflected within CK editor. eg: $page->body = $sanitizer->purify("<br />Some Content<br /><br />More Content"); Results in one long string in CK. Bug? Or am I missing something here.
  18. Using the page lister to select some custom fields for reporting purposes, all works as expected until I save the bookmark. This works and returns expected results: Once saved I get an error: Any ideas? Is there a way I can enable subselectors for PageLister?
  19. I'm still having problems with customer selectors to find selectable pages. Specifically when trying to include unpublished pages, my custom selector is: template=horse_profile,include=all This selector only returns published pages, which is driving me nuts!
  20. While I understand this is not ideal, it's the only way to get things to work with wiremail on the servers in question. Other than sending plain text emails, or using a third party mail library.
  21. I only replaced \r\n with PHP_EOL in the core. I now have now come across this in two cases, where thunderbird in particular, will not display HTML email, UNLESS I use the above mentioned code. This goes for 2.7 > I'm guessing it's a delivery / configuration issues, but why it doesnt work with \r\n I do not know. Strangley localhost sends correctly, comparing email sources, I can see the production server is adding additional returns: Local: X-Mailer: ProcessWire/WireMail MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="==Multipart_Boundary_x971272fd25f1cf0be14fb1604bb269eax" Message-Id: <20170705010932.9296B41846@localhost.localdomain> Date: Wed, 5 Jul 2017 11:09:32 +1000 (AEST) Production: X-Mailer: ProcessWire/WireMail MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="==Multipart_Boundary_xc4dc56a7cc1f6fe4eadc7f63e3e9f458x" Message-Id: <20170704234256.C3CA113208EC@XXX.XXX.com.au> Date: Wed, 5 Jul 2017 09:42:56 +1000 (AEST) Could be more sinister, gmail displays the HTML as: So it might be the way I'm reading the file? ie: wireRenderFile('path/to/email/template'); <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.= w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">=0A<html xmlns=3D"http://www.= w3.org/1999/xhtml">=0A<head>=0A<meta name=3D"viewport" content=3D"width=3Dd= evice-width" />=0A<meta http-equiv=3D"Content-Type" content=3D"text/html; c= harset=3DUTF-8" />=0A<style>=0A/* -------------------------------------=0A = GLOBAL=0A------------------------------------- */=0A* {=0A margin: 0;= =0A padding: 0;=0A font-family: "Helvetica Neue", "Helvetica", Helvetica,=
  22. Problem: I've created a page table on a parent with existing children, however PW is not prompting to add existing pages to the table. I'm sure it did this in previous versions, unless I'm missing something?
  23. Regular include doesn't work. I get an error because I'm using wireRenderFile inside my included file: Call to undefined function wireRenderFile() This used to work on 2.7 so not sure what's changed.
×
×
  • Create New...