-
Posts
1,065 -
Joined
-
Last visited
-
Days Won
11
Posts posted by Zeka
-
-
So they don't show even after you click 'Find pages to translate'?
-
Hi @a-ok
Take a look at this part of 3.0.87 blog post
https://processwire.com/blog/posts/pw-3.0.87/#new-field-template-context-settings
-
2
-
-
As @Macrura said in most cases ProCache and WireCache is the way to go for me. Also what I have found super useful is namespaces for WireCache, as for the example you can load all cache for a page with namespaced cache and preloadFor method just with one query.
7 hours ago, Macrura said:Another thing that is interesting to do is $cache within $cache, ... had to do it in a few places, it was tricky, but it really made a difference in speed..
There is CacheNesting module, I haven't used it but it should help to handle such scenarios
-
4
-
-
Hi.
I have CKEditor field with the name 'wysiwyg'
In config.js and config-wysiwyg.js I have such code
CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: config.language = 'ru'; // config.uiColor = '#AADC6E'; };
File config-wysiwyg.js get loaded on the page edit screen, but the language is not changed. But if I put 'language:ru' to 'Custom Config Options' on the field edit page everything works as expected. What is strange, that is if I try to change UI color via config-wysiwyg.js - color get changed.
CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: config.language = 'ru'; config.uiColor = '#AADC6E'; };
So it looks live there is some special case with language property.
Did somebody have such behavior? I want to have all field-relative settings in the one file to not get a mess.
-
Ryan, thanks for the update.
It would be great to get an update of "Selectors as regular and associative arrays".
-
5
-
-
@David Karich Great module. Just curious is it possible to sort pages by page views?
-
1
-
-
I think that Functional API quite convenient, maybe we can introduce two code boxes with examples without and with Functional API with notice that it doesn't work out of the box and require some modification of config.php and add a link to the blog post or documentation page.
-
@manlio Have you deleted repeater fields with same names?
-
3
-
-
Just a note about fonts. Maybe we should consider fonts with the Cyrillic glyphs support? In the longer term, there probably maybe some messages on the forum or even parts of documentation translation in Ukrainian or Russian languages. Without Cyrillic glyphs, this parts will fallback to another font and it will look not consistent with other parts.
-
4
-
-
$this->addHookAfter('ProcessTemplate::buildEditForm', function ($event) { $form = $event->return; $template = $event->arguments[0]; $icon_field = $form->find('name=pageLabelIcon')->first(); $icon_field->collapsed = Inputfield::collapsedHidden; $field = $this->modules->get('InputfieldText'); $field->attr('id+name', 'template_emoji'); $field->icon = 'list-ol'; $field->attr('value', $template->template_emoji); $field->columnWidth = 100; $form->insertAfter($field, $icon_field); $event->return = $form; }); $this->addHookBefore('ProcessTemplate::executeSave', function ($event) { $template = $this->templates->get($this->input->post->id); $template->set('template_emoji', $this->input->post->template_emoji); }); $this->addHookAfter('ProcessPageListRender::getPageLabel', function ($event) { $page = $event->arguments('page'); $template = $page->template; if($template->template_emoji) { $event->return = $template->template_emoji . ' ' . $event->return; } });
-
6
-
1
-
-
@BFD Calendar You got
Fatal error: Uncaught Error: Call to a member function each() on null in
So you have to make sure that the is workshops_list is populated and contains an iterable object that extended from WireArray, so you can use each method on it.
if(count($item->workshops_list)) { $out .= $item->workshops_list->each( "<font color='green'>| {title}</font>" ); }
-
2
-
-
@ren Great tutorial, thanks.
-
2
-
-
-
@Michkael Flexbox (css), https://github.com/liabru/jquery-match-height (javascript).
-
1
-
-
@SwimToWin There RecureMe module for managing of recuring dates
-
1
-
-
Hi.
Is it possile to use Inputimagefield on a process module page?
$f = $this->wire('modules')->get('InputfieldImage'); $f->setAttribute('name', 'image'); $f->label = $this->_('Image'); $f->columnWidth = 75; $markup->add($f);
This code renders field but it obviously doesn't work) I have read somewhere on the forum that this input type intended to work in the context of page edit, so it's not possible to use it on a module config page, but process page is actually a page, so I thought there is might be the way how to get it working.
Thanks, Eugene.
-
Hi.
I have a hook to Pages::saveReady that changes page name and I get warning like
Changed page URL name to "doc-1103" because requested name was already taken.
or
Warning, the name you selected "dokument" has been changed to "doc-1104".
I think that I have the same case like there https://github.com/processwire/processwire-issues/issues/648
Is it possible to somehow silence this warning?
Thanks.
-
Hi.
I got this error when trying to access Parent properties in Custom find (Selector field) white configure page reference field
I'm on a clean installation of PW 3.0.122 and PHP 7.2.4
Please confirm.
-
1
-
-
-
@Laikmosh I'm not sure, but I think that there is no difference in performance between $pages, wire('pages) and pages().
There is also a third way to access API variables - functions API https://processwire.com/blog/posts/processwire-3.0.39-core-updates/#new-functions-api
-
2
-
1
-
-
42 minutes ago, felixthecat said:
Thank you... that is working ?
But what is the relation between pagimages and the field?Here is the description of Pageimages class
ProcessWire Pageimages Pageimages are a collection of Pageimage objects. Typically a Pageimages object will be associated with a specific field attached to a Page. There may be multiple instances of Pageimages attached to a given Page (depending on what fields are in it's fieldgroup).
-
2
-
-
5 minutes ago, kongondo said:
Ah, yes. As documented here as well:
@kongondo As for me it should be changed to setArray as in current implementation WireArray() looks like an alias (in most scenarios) for WireArray->import and not new WireArray().
-
1
-
-
11 minutes ago, kongondo said:
I've only had a quick look at your post. It could be 'default' is a reserved word/keyword?
No, it behaves in that way when different 'keys' have the same values. One more example
$array = WireArray([ 'test' => 'test1', 'test1' => 'test1', 'test2' => 'test2' ]); d($array); count => 2 items => array (2) - test => "test1" (5) - test2 => "test2" (5)
Actually, I think that it's a bug in WireArray() function as if use new WireArray() it works as expected$test = [ 'test' => 'test1', 'test1' => 'test1', 'test2' => 'test2' ]; $array = new WireArray(); $array->setArray($test); d($array); count => 3 items => array (3) - test => "test1" (5) - test1 => "test1" (5) - test2 => "test2" (5)
Here is code for WireArray();
public static function newInstance($items = null, $class = '') { if(empty($class)) $class = get_called_class(); /** @var WireArray $a */ $a = new $class(); if($items instanceof WireArray) { $items->wire($a); $a->import($items); } else if(is_array($items)) { $a->import($items); } else if($items !== null) { $a->add($items); } return $a; }
So the issue is in the usage of import method as it skips any items already present in WireArray.
-
2
-
-
$insert = new Event(5555); if($s->count() > 5) { $s->insertAfter($insert, $s->eq(5); }
WANTED: Sanitizer whith regex!
in Wishlist & Roadmap
Posted
https://processwire.com/api/ref/sanitizer/match/