-
Posts
992 -
Joined
-
Last visited
-
Days Won
3
Everything posted by PWaddict
-
Thank you @Juergen Here is the final code in case anyone wants to use the grid (UIkit) on a checkbox: $checkbox = new \FrontendForms\InputCheckbox('checkbox'); $checkbox->setLabel('My Checkbox Label'); $checkbox->setRule('required')->setCustomMessage('My custom required text'); $checkbox->getErrorMessage()->setAttribute('class','uk-width-1-1'); // Add uk-width-1-1 to prevent the text displayed as part of the grid $checkbox->getFieldWrapper()->setAttributes(['data-uk-grid', 'class' => 'uk-grid-small']); $checkbox->prepend('<div class="uk-width-auto">'); $checkbox->append('</div>'); $checkbox->getLabel()->wrap()->setAttribute('class', 'uk-width-expand'); $form->add($checkbox);
-
Hey @Juergen I need to make the checkbox field look like this: <div class="uk-grid-small" uk-grid> <div class="uk-width-auto"> <input id="checkbox" class="uk-checkbox" type="checkbox"> </div> <div class="uk-width-expand"> <label for="checkbox">Checkbox Label</label> </div> </div> But it's not possible (I think) without first use the method $form->appendLabelOnCheckboxes(true); but it seems it doesn't do anything at all.
-
Custom fields validation inside Images field.
PWaddict replied to PawelGIX's topic in General Support
Thanks a lot @Robin S your code works great. I was trying on saveReady hook too using the below code but couldn't make it work properly. I wasn't using foreach loop as the image field I was testing it accepts only 1 image. $wire->addHookAfter('Pages::saveReady', function($event) { $page = $event->object->getPage(); if ($page->template->name != "my-page-template") return; if($page->image->custom_image_field == "") { $page->addStatus(Page::statusUnpublished); } }); -
Custom fields validation inside Images field.
PWaddict replied to PawelGIX's topic in General Support
@Robin S Nice hook. I'm trying to unpublish the page if the custom field is empty but it's not working. if(!$inputfield->value) { $page->addStatus(Page::statusUnpublished); } Any idea how to accomplish that? -
CroppableImage3 1.2.0
-
[SOLVED] How to make file/image description required?
PWaddict replied to PWaddict's topic in General Support
I ended up using a custom image field as required for the image description to add some notes too. With the following hook on ready.php, I just copy the custom image field description value to the native description field so it can be displayed as alt attribute on RTE images. The native description field no need to be displayed in the editor. It can be as 0 on "Number of rows for description field?" $wire->addHookBefore('Pages::saveReady', function($event) { $page = $event->arguments('page'); if ($page->template->name != "my-template") return; foreach($page->images as $image) { $image->description = $image->image_description; } }); -
[SOLVED] How to make file/image description required?
PWaddict replied to PWaddict's topic in General Support
If that native description field is actually an inputfield then I guess that might work but currently there is no point to even try anything for now as the images will be uploaded via ProcessPageEditImageSelect and there is a serious issue with it. -
Hello! I would like to have file/image description required. Is it possible? Or should I create a custom field for it? But then how can I output alt attribute value on a TinyMCE image?
-
Hello! Is there any way to force the recreation of the webp variation when the crop is edited?
-
Hello! I trashed a page and when I checked the Trash to restore it I noticed that there is no "restore" button on it. Not even a "view" button. There is only "edit" and "move". If I set the page to "Unpublished" while on trash only then the "view" button appears but still there is no "restore" button at all. The page belongs to a template that is used for children. I'm using a brand new ProcessWire installation 3.0.244. Also, upgraded it to 3.0.245 and the issue remains. I do not have that issue on a website with 3.0.229. EDIT: While I'm using 3.0.245 now, I created a new children page and then trashed it and the "restore" / "view" buttons are now visible.
-
- 2
-
-
I'm testing it on a brand new website and my init.php doesn't have any other hook. If I change the hook to Page::render it works so it seems it's not a PW issue. <?php namespace ProcessWire; if(!defined("PROCESSWIRE")) die(); /** @var ProcessWire $wire */ /** * ProcessWire Bootstrap Initialization * ==================================== * This init.php file is called during ProcessWire bootstrap initialization process. * This occurs after all autoload modules have been initialized, but before the current page * has been determined. This is a good place to attach hooks. You may place whatever you'd * like in this file. For example: * * $wire->addHookAfter('Page::render', function($event) { * $event->return = str_replace("</body>", "<p>Hello World</p></body>", $event->return); * }); * */ wire()->addHookAfter('Form::render', function ($event) { $return = $event->return; $return = str_replace('<span class="asterisk">*</span>','<span class="myAsterisk">+</span>', $return); $event->return = $return; });
-
No, I'm talking about the TinyMCE autolink plugin. You can find it on the Input tab.
-
Hmm... it seems that it only works if you press "space" after typing www.example.com Back to good old TextformatterMakeLinks module 😎
-
Hello. I have activated the "autolink" plugin on a TinyMCE textarea field but it doesn't create hyperlinks. On body I typed www.example.com and it still outputs as plain text. I'm new to TinyMCE so I'm not sure if I'm doing something wrong or autolink is broken.
-
@Juergen congrats for your module. I installed it today for the first time and while doing some tests I noticed that hooks doesn't work. I'm trying to add a font awesome icon on the error message with the hooking example you have on readme but it's not working. I tested also the other example for hooking on label's asterisk and doesn't work either.
-
[Solved] Is hosting with Litespeed webserver seamless?
PWaddict replied to ausblick's topic in General Support
Hi there. I'm using ProcessWire on Litespeed servers for 10+ years. There are NO compatibility issues. Everything you do with regular Apache you can do on Litespeed too. Google "Litespeed vs Apache" and you can easily find out why you should stay with Litespeed 🙂 -
Hello, I'm outputing repeater content in ProcessWire way like this instead of the classic foreach. <?= preg_replace('/(.*),/','$1 &', $page->datetimes->implode(", ", "{day} {time_start}-{time_end}")) // Monday 19:00-21:00, Tuesday 19:00-21:00 & Wednesday 19:00-21:00 ?> Is there a ProcessWire way to output the content like below where if the time_start and time_end have the same values on all days then display them only once at the end of the string: Monday, Tuesday & Wednesday 19:00-21:00
-
Yep, Stripe is easier because it has way much better documentation than PayPal. @bernhard You will probably get more help by checking out my PayPal module than looking at the PayPal documentation.