-
Posts
1,065 -
Joined
-
Last visited
-
Days Won
11
Everything posted by Zeka
-
Default 1st page-edit tab / redirect to custom tab
Zeka replied to dragan's topic in General Support
@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 -
trackChanges does not track everything of an object?
Zeka replied to Guy Verville's topic in General Support
@Guy Verville Take a look at this thread, maybe you will find something that solves your issue -
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.
-
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);
-
@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.
-
@Mackski wire()->addHookAfter("InputfieldPage(name=categories)::renderReadyHook", function($event) { $object = $event->object; bd($object->helpTipContent); }); Just tested it and it works.
-
wire()->addHookAfter("ProcessPageEdit::buildForm", function($event) { $form = $event->return; $fieldset = $form->find("id=ProcessPageEditContent")->first(); $fields = $fieldset->children; bd($fields->each('name')); });
-
@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.
-
Migrating/Copying Template Data to Another Template
Zeka replied to louisstephens's topic in API & Templates
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. -
?♂️ Atom autocomplete is awesome. @LostKobrakai, @netcarver Thanks guys, really.
-
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?
-
Thanks, @Robin S
-
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?
-
$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.
- 11 replies
-
- 1
-
- pagination
- get
-
(and 2 more)
Tagged with:
-
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?
-
@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.
-
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.
-
How to optimize the admin panel which has large number of pages
Zeka replied to Mirza's topic in General Support
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.- 8 replies
-
- 2
-
- optimize admin panel
- performance issue
-
(and 1 more)
Tagged with:
-
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();
-
https://processwire.com/api/include/
-
Russian titles translated into names with latin letters but not Hebrew
Zeka replied to Sten's topic in Multi-Language Support
http://www.viceregency.com/Translit.htm -
Logged out from admin by visiting front on .localhost domain
Zeka replied to Zeka's topic in General Support
@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? -
http://mcdonalds.az/