-
Posts
1,065 -
Joined
-
Last visited
-
Days Won
11
Everything posted by Zeka
-
Is it possible to remove the Title field on PageTableNext field items?
Zeka replied to artfulrobot's topic in API & Templates
Hi @artfulrobot Have you seen this thread? Does it answer your question? -
Templates & access restictions on multilanguage site
Zeka replied to DV-JF's topic in API & Templates
Hi @DV-JF Probably you can use 1 option and then make a hook to 'ProcessPageView::pageNotFound' and within the hook, definition make a redirect to the login page like $this->wire()->pages('/login/')->url([ 'language' => $this->wire()->user->language, ]) -
I think that the first example would be more performant as every declaration of the hook creates an additional WireHook object that should be processed. While I think that difference in performance impact would be hard to measure in a typical PW site, I would stick with the first way not from the performance side, but from the side of structure, clarity, and repetition of the code, but it still depends on actual hook and what it is doing etc
-
Hi @Juergen Just tested and in my setup, if there are any nested fields in the fieldset with an error the parent fieldset is get automatically opened. From what I see in the code it is the intended behavior https://github.com/processwire/processwire/blob/master/wire/core/InputfieldWrapper.php#L777 In any case you can manually set collapsed state of inputfields inside the getModuleConfigInputfields public function getModuleConfigInputfields(array $data) { .... foreach ($inputfields->getErrorInputfields() as $inputfield) { $inputfield->collapsed = Inputfield::collapsedNo; } return $inputfields; } or even like this public function getModuleConfigInputfields(array $data) { .... foreach ($inputfields->getErrorInputfields() as $inputfield) { $inputfield->collapsed = Inputfield::collapsedNo; $parents = $inputfield->getParents(); foreach ($parents as $parent) { $parent->collapsed = Inputfield::collapsedNo; } } return $inputfields; }
-
Hi @heldercervantes . Here are a few projects I've done, both previously done on WP. The first one is smaller 45k pages, the second one already has 484k pages. https://obukhiv.info/ https://socportal.info/
-
Hi @MateThemes Usually, If I need something simple I use Repeater field with depth option, if something more advanced I use Repeater Matrix field with depth.
-
PW 3.0.209 – Core updates and an AI that knows ProcessWire
Zeka replied to ryan's topic in News & Announcements
@ryan Thank you for one more year with PW. It would be great to hear about the PW roadmap for 2023. Been playing with GPT chat for almost a week, crazy stuff. AI will definitely affect humanity more than the invention of manufacturing and electricity -
Hi @jsilmarovi You could bootstrap PW instance to your Laravel app https://processwire.com/docs/front-end/include/ and that use PW api to create or edit pages https://processwire-recipes.com/recipes/create-page-via-api/ https://gist.github.com/lokomotivan/e0a20f96b6df02970bccd700a119930e
-
$page->repeater->find('status!=unpublished')
-
Thanks, @teppo information and example, now it's more apparent to me how and where this feature could be used.
-
Hi @teppo It would be great to get some insight into the usage of aliases. What is the intended way of using it?
-
PW 3.0.203 – Core updates + custom fields for comments
Zeka replied to ryan's topic in News & Announcements
As @Ivan Gretsky said, the core of CKEditor 5 has changed and implementing it in PW will require significant changes, so maybe we should consider other options like https://imperavi.com/article. It is also used in Bolt CMS (not a promotion). -
Hi @digitalhandwerker In your scenario, where you are getting pages by their paths would be more appropriate to use $page->getByPath() method like $pages->getByPath('/en/', [ 'useLanguages' => true, ]);
- 2 replies
-
- multi-language
- get
-
(and 1 more)
Tagged with:
-
admin page cannot be deleted: it has “system” and/or “systemID” status
Zeka replied to froot's topic in General Support
Hi @fruid You have to turn on advanced mode by setting this in your config.php $config->advanced = true; Than on settings tab on that page you will be able to toggle 'system' checkbox -
Hi @JerryDi I would recommend getting to know with 'owner' selector as it could be beneficial in the setups Ryan provided. https://processwire.com/blog/posts/processwire-3.0.95-core-updates/
-
As an option https://processwire.com/blog/posts/pw-3.0.173/#telling-processwire-what-page-to-render
-
Preventing file compiler during 2.x to 3.x upgrade?
Zeka replied to MarcC's topic in General Support
https://github.com/processwire/processwire/blob/master/wire/config.php#L516 -
Hi @Matzn <?php namespace ProcessWire; class ParentModule extends WireData implements Module, ConfigurableModule { public static function getModuleInfo() { return [ 'title' => 'Parent Module', 'version' => 1, ]; } const defaultValue = '12345'; public function __construct() { $this->set('api_user', self::defaultValue); // set default value in construct } public function getApiUser() { return $this->api_user; } public static function getModuleConfigInputfields(array $data) { if(!isset($data['api_user'])) $data['api_user'] = self::defaultValue; $form = new InputfieldWrapper(); $f = wire('modules')->get('InputfieldText'); $f->name = 'api_user'; $f->label = 'API USER'; $f->value = $data['api_user']; $form->add($f); return $form; } } <?php namespace ProcessWire; class ChildModule extends ParentModule { public static function getModuleInfo() { return [ 'title' => 'ChildModule', 'version' => 1 ]; } public function __construct() { parent::__construct(); bd($this->getApiUser()); bd($this->wire()->modules->getModuleConfigData('ParentModule')); } } Take a look at the construct method of ChildModule. Without calling parent::__construct you will not be able to get what you want. Also you can use $this->wire()->modules->getModuleConfigData('ParentModule') to get config data of module.
-
Hi @prestoav Try to output this https://processwire.com/api/ref/session/get-all/
-
Accessing previous version of page before/after page save
Zeka replied to Pete's topic in General Support
Not sure, but probably getFresh method is applicable in such a case. https://processwire.com/api/ref/pages/get-fresh/ -
https://processwire.com/docs/modules/hooks/#how-can-i-add-a-new-method-via-a-hook
-
Hi @theoretic You are adding a property via hook instead of method https://processwire.com/api/ref/wire/add-hook-method/