Jump to content

Zeka

Members
  • Posts

    1,065
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zeka

  1. @dragan Maybe the more right way to handle it in your case is to hide the first tab by the hook, so 'Projekt' tab will be the first tab even in the markup. Take a look at this post
  2. @Guy Verville Take a look at this thread, maybe you will find something that solves your issue
  3. @netcarver Great that you solve the issue, but as the further enhancement it would be nice to save field via ajax. I have found this module that intended to do it https://github.com/Klenkes/AjaxSave. So, maybe you can adapt it to your project needs.
  4. There is 'wiretabclick' event in JqueryWireTabs that you can use to trigger page save. https://github.com/processwire/processwire/blob/50f2834a0ae2a9f9f2ac53439184ebdc04db2f54/wire/modules/Jquery/JqueryWireTabs/README.txt#L31 Also, it worth to look at @tprs realization of hotkey save in the AdminOnSteroid module.
  5. Hi @Mackski wire()->addHookAfter("ProcessField::buildEditForm", function(HookEvent $event) { $form = $event->return; $process = $event->object; $f = $process->getField(); $t = $this->wire(new InputfieldWrapper()); $t->attr('title', $this->_x('HelpTipContent', 'tab')); $t->attr('class', 'WireTab'); $t->attr('id', 'help_tip_tab'); $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.'); $_form = $this->wire(new InputfieldWrapper()); $_form->attr('id', 'helptip_inputfield_wrapper'); $_form->append($field); $template_delete_tab = $form->find('id=delete, class=WireTab')->first(); $t->add($_form); $form->insertAfter($t, $template_delete_tab); $event->return = $form; }); wire()->addHookBefore('ProcessField::executeSave', function($event) { $field = wire()->fields->get($this->input->post->id); $field->set('helpTipContent', $this->input->post->helpTipContent); }); // at render time wire()->addHookAfter("Inputfield::renderReadyHook", function($event) { $inputfield = $event->object; d($inputfield->get('hasField')->helpTipContent); }); I have tested it with several types of inputfields and it works. But I'm not sure about this part d($inputfield->get('hasField')->helpTipContent);
  6. @Mackski From your screenshot, it looks like you are looking for data in the wrong place. Your first hook adds inputfieldTextarea to InputfieldPage (page reference field) editing page. The second one is executed on pages which includes page reference fields.
  7. @Mackski wire()->addHookAfter("InputfieldPage(name=categories)::renderReadyHook", function($event) { $object = $event->object; bd($object->helpTipContent); }); Just tested it and it works.
  8. wire()->addHookAfter("ProcessPageEdit::buildForm", function($event) { $form = $event->return; $fieldset = $form->find("id=ProcessPageEditContent")->first(); $fields = $fieldset->children; bd($fields->each('name')); });
  9. @J_Szwarga It's not clear what do you want to limit? If you use the page reference field for assigning speakers, so you actually limit the list of speakers for certain event by this field.
  10. I think you will find useful Admin Actions Module http://modules.processwire.com/modules/process-admin-actions/ It has a branch of predefined actions, but you can create own.
  11. ?‍♂️ Atom autocomplete is awesome. @LostKobrakai, @netcarver Thanks guys, really.
  12. In a method of a custom process module, I try to force file download. $http = new WireHttp(); or $http = $this->wire(new WireHttp()); Processwire namespace is defined in the file. I'm getting Class 'Processwire\WireHttp' not found. The question is why?
  13. Hi. I'm trying to save an xls file to temp folder .... $writer = IOFactory::createWriter($spreadsheet, 'Xls'); $wireTempDir = wire('files')->tempDir('testname' . time()); $writer->save($wireTempDir->get() . "featuredemo.xls"); The issue is that $wireTempDir return the path to temp folder like D:/laragon/www/p/app/site/assets/cache/WireTempDir/.testname1531040249/0/ But it creates only .testname1531040249 folder without subfolder '0'. Am I missing something?
  14. $allbooks = $pages->find("template=book, sort=$sort, $q, $tagged, $select_studio, limit=10"); if ($input->get()->count() && !$allbooks->count() && $input->pageNum > 0) { $url = $page->url([ 'http' => true, 'pageNum' => 0, 'data' => $input->get()->getArray() ]); $session->redirect($url); } Not tested and may result in redirection loop, but just an idea. Tested, it works.
  15. But it should)))) There is only $config->dbStripMB4 option that I've found that allows to strip these complex emojis instead of saving them as ????. Any other ideas?
  16. @dragan Thanks for your attention to the thread. Yes, you are right, simple arrows work without problems, but try to insert more complex emoji as ????? P.S. It's multilanguage text field.
  17. Hi. I want to show emojis in page's title and description. But while saving a page text that goes after an emoji gets stripped. I'm using utf8_general_ci as charset, but for title and descriptions tables I've changed it to utf8mb4_general_ci. Even after that 4-byte emojis saves as ???? in DB. Is there something that I missed? Thanks.
  18. Use Opcache to cache raw PHP Update your PHP version Use ListerPro to customize your listings, so you will use fewer server resources to list pages for every user.
  19. Hi. In a multi-language setup where page URL is changed via the hook to 'Page::path' view links in the 'View' tab are correct 'hooked' only for the user`s current language, but links for other languages are original (not hooked). How can I get hooked links for other languages in the 'View' tab?
  20. I think you have to unzip it firstly and then add images to your images field $zip = $config->paths->cache . "archive.zip"; $dst = $config->paths->cache . "temp-zip/"; $items = $files->unzip($zip, $dst); $page->of(false); if(count($items)) { foreach($items as $item) { $page->images->add($item); } } $page->save();
  21. https://processwire.com/api/include/
  22. @dragan, @bernhard, @Doug G Thanks for answers. Flushing of DNS records helped and now it works with $config->sessionFingerprint = 2; As for .localhost - I have chosen it as it was reserved for local testing and dev scenarios. Is there better domain name for local development?
×
×
  • Create New...