ngrmm
Members-
Posts
446 -
Joined
-
Last visited
-
Days Won
3
ngrmm's Achievements
-
it's working for me with the code below Please check for typos. Is you page reference filed name really report? And is it a single or multiple page? $call = $pages->get(1234); $report = $pages->get(4321); $new_report = $pages->clone($report); $new_report->of(false); $new_id = uniqid(); $new_report->title = $new_id; $new_report->name = $new_id; $new_report->save(); $new_report->of(true); $call->of(false); $call->report = $new_report; // $call->report->add($new_report); $call->save(); $call->of(true);
-
@Frank Vèssiaplease check if your page reference field is accepting the template of the new cloned page.
-
Hook to check for repeater items with same field values
ngrmm replied to Bike's topic in API & Templates
@Bike what do you actually mean by dropdown field? Which type is it? a page reference field? Maybe your dropdownField is an array and not boolean or a string. -
Best way to deal with multilingual images that are optional
ngrmm replied to joe_g's topic in Multi-Language Support
You could use a hook to create those new fields and add them to certain templates. -
@robert it seems that this module does not work with the latest PW version Schwerwiegender Fehler: Uncaught TypeError: Cannot access offset of type string on string in site/modules/ProcessTranslatePage/ProcessTranslatePage.module.php:189 #0 site/modules/ProcessTranslatePage/ProcessTranslatePage.module.php(59): ProcessTranslatePage->setLanguages() #1 site/modules/ProcessTranslatePage/ProcessTranslatePage.module.php(41): ProcessTranslatePage->initSettings() #2 wire/core/ModulesLoader.php (168): ProcessTranslatePage->init() #3 wire/core/ModulesLoader.php (100): ModulesLoader->initModule() #4 wire/core/ModulesLoader.php (111): ModulesLoader->triggerInit() #5 wire/core/Modules.php (338): ModulesLoader->triggerInit() #6 wire/core/ProcessWire.php (775): Modules->triggerInit() #7 wire/core/Wire.php (413): ProcessWire->___init() #8 wire/core/WireHooks.php (968): Wire->_callMethod() #9 wire/core/Wire.php (484): WireHooks->runHooks() #10 wire/core/ProcessWire.php (909): Wire->__call() #11 wire/core/ProcessWire.php (665): ProcessWire->__call() #12 wire/core/ProcessWire.php (613): ProcessWire->setStatus() #13 wire/core/ProcessWire.php (315): ProcessWire->load() #14 index.php (52): ProcessWire->__construct() #15 {main} thrown (Zeile 189 in site/modules/ProcessTranslatePage/ProcessTranslatePage.module.php) Diese Fehlermeldung wurde angezeigt wegen: Sie sind als Superuser angemeldet. Fehler wurde protokolliert.
-
Install MarkupGoogleRecaptcha on FormBuilder form
ngrmm replied to couturef's topic in General Support
@couturef i doubt that the module is up to date please check the support thread of the module here: -
Trying to link to a specific place on another page
ngrmm replied to Charlie W's topic in General Support
@Charlie W your question ist not directly related to processwire. You would get or find an answer more quickly on stackoverflow. Or just ask chatgpt, claude, … acme/#sliding is correct. Just make sure that you do not have multiple elements with the same id. Then you link <a href='#siding>siding</a> should get you to your target <div id='siding'></div> -
New post: Using date range fields in ProcessWire
ngrmm replied to ryan's topic in News & Announcements
@ryan is it also possible to disable a date range via setting like: $wire->addHookBefore('InputfieldDateRange::getSettings', function($e) { $f = $e->object; if($f->name != 'booking_date') return; // // set Christmas until New Years Day to be disabled // $f->disabledDates = [ '2024-12-25 - 2025-01-01' ]; }); UPDATE: right now I'm doing this // // helper function // function getDatesBetween($startDate, $endDate) { $dates = []; $currentDate = strtotime($startDate); $endDate = strtotime($endDate); while ($currentDate <= $endDate) { $dates[] = date("Y-m-d", $currentDate); $currentDate = strtotime("+1 day", $currentDate); } return $dates; } $wire->addHookBefore('InputfieldDateRange::getSettings', function($e) { $f = $e->object; if($f->name != 'booking_date') return; $disabledDates = getDatesBetween("2024-12-25", "2025-01-01"); // // set Christmas until New Years Day to be disabled // $f->disabledDates = $disabledDates; }); -
access a related page templatefield's label in the current user language
ngrmm replied to froot's topic in API & Templates
@froot so related_tutor or related_movie, is a page field right? Is it a single or multiple page field? If multiple (by default), then you would need to select one from the array. like: …related_tutor->first->template->fields->skills->label and check this https://processwire.com/api/ref/field/get-label/ -
[SOLVED] How to hook into page ADD NEW and change sort order?
ngrmm replied to Klenkes's topic in General Support
I've no idea how to tweak that. But you could also create a custom backend page, see here. -
@rushy go here. There are many ways. Maybe one fits you
-
@leode you also edited your config.php right?
-
Resaving a page from the same variable and duplicate items in repeaters
ngrmm replied to DrQuincy's topic in API & Templates
@DrQuincy Matrix repeaters are pages themselves. They are different than usual fields. First you create a matrix type and add content. Then save the matrix page and then you can save your actual page. Each time you add a matrix type a new page is created. You can find these pages in the page tree under admin- 1 reply
-
- 1
-
Did you try str_replace?
-
@Purple your question is more related to php as to processwire. You better search in stackoverflow for these kind of question. Anyway, you could use a for loop. This code gives you the first images of the first five category children. for ($i = 0; $i <= 4; $i++) { foreach($categories as $category) { $image = $category->children->eq($i)->images->first; } }