Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/13/2024 in all areas

  1. Hello @dotnetic, it fits exactly. ? It's what I was looking for, just great, thank you very much for that! I found this post in the morning: How to remove breadcrumbs, modify headline? and would most probably have failed on it .. It feels good while you grow with a project and learn a lot of basic things and have the support of the great processwire- community. And thats motivating too. This is not a given, so thank you all!
    3 points
  2. Is it possible to upgrade module to work with PHP 8.2 or 8.3 maybe? It only works on PHP 7.4 at least here ... Thank you R
    2 points
  3. Let's assume you want to change the title of a an edit page. You could hook ProcessPageEdit:execute in a file like site/ready.php like described here. Adapt the template name in the following code to your needs: $wire->addHookAfter('ProcessPageEdit::execute', function (HookEvent $event) { $pageEdit = $event->object; $page = $pageEdit->getPage(); if ($page->template != 'shop') { return; // return early } $this->wire('processHeadline', 'My new headline'); // or modify the existing headline // $headline = $this->wire('processHeadline'); // $this->wire('processHeadline', $headline . " - " . date('d.m.Y', $page->created)); });
    1 point
  4. Currency Conversion for ProcessWire This module is designed for performing currency conversions among ~165 world currencies. It uses OpenExchangeRates.org (or compatible) for data so that currency exchange rates are always up-to-date. It provides various API functions that you can use to convert from one currency to another. This is especially handy for generating rate tables in multiple currencies or giving users of your site the option to see prices in their currency. How to install How to use API documentation Modules directory page GitHub Page Download ZIP Live Example Requires ProcessWire 2.4.0 or newer. To use the quick-installer from your modules screen, paste in ServiceCurrencyConversion. Basic Example $cc = $modules->get('ServiceCurrencyConversion'); $dollars = 100; // amount of currency we want to convert $euros = $cc->convert('USD', 'EUR', $dollars); echo "<p>$dollars US Dollars equals $euros Euros</p>"; For a live example of a currency conversion tool built with this module see the included convert.php file and test it out here.
    1 point
  5. Hi everyone! I built this module trying to solve the following issue. Most of the time I use Repeater Matrix types with a few fields wrapped in a fieldset that are for configuring the behaviour/rendering of a specific repeater type, and are not really content related so I had always wanted to have them kind of hidden, but with a small preview of that the options are set (which I've yet to do). https://github.com/elabx/FieldtypeFieldsetPanel
    1 point
  6. Thanks for the fast and great reply. // Email $email = new \FrontendForms\InputEmail('scf_email'); // make usage of InputEmail $email->setLabel($fields->get('scf_email')->$label); $email->setRule('required'); $form->add($email); I think this made the trick!!
    1 point
  7. Hello @Flashmaster82 You have only added the required Validator. There are a lot of examples inside the examples folder how to validate an email address (fe at the contact forms). In this folder you will also find a special file with a lot of validation examples: https://github.com/juergenweb/FrontendForms/blob/main/Examples/field-validation.php. This file contains examples of (nearly) all possible validators and how to add them to an input field. There are 2 special validators for validation of an email, which are interesting for you: Validate email address (This is what you are asking for) Validate if email address exists (This checks for an active DNS record) In the next steps I will show you 3 possibilities (option) how to validate an email field. Option 1: Add the additional email validators to your code example // Email $email = new \FrontendForms\InputText('scf_email'); $email->setLabel($fields->get('scf_email')->$label); $email->setRule('required'); $email->setRule('email'); // checks for the right syntax of the email $email->setRule('emailDNS'); // optional: checks if the email has a valid DNS record $form->add($email); This works, but it is not the recommended way for emails. You have used an InputText input field, but for emails there is a special input field, which includes the mentioned validators by default: InputEmail Option 2: Instead of using InputText, it is better to use InputEmail, which includes email valdiation by default // Email $email = new \FrontendForms\InputEmail('scf_email'); // make usage of InputEmail $email->setLabel($fields->get('scf_email')->$label); $email->setRule('required'); $form->add($email); As the last option, I want to show you a pre-defined email input. To simplify life, I have created pre-defined input field types for the most used form fields, like surename, lastname, email, message and so on. You will find all this pre-defined fields inside the defaulf folder. These default fields includes validators and labels for these inputfields and the code is very short. Option 3: This code includes all email validators and the pre-defined email label - it is the shortest version. // Email $email = new \FrontendForms\Email('scf_email'); $email->setRule('required'); $form->add($email); Now you have 3 options, where you can choose from. Best regards Jürgen
    1 point
  8. Hello, I'm looking for a way to append a title beside the headline of a page which is beeing edit. It's about ease of use, at first glance. To figure out, first I tried something like that: (file "_content-head.php" of AdminThemeUikit (just Testing and remove)); if($headline !== '' && !$adminTheme->isModal) { # Test-Line: get current page-id (edit) $p = $this->pages->get($this->input->get->id); # Test-Line: check (type=text) page_field isn't empty $appendix = !$p->page_field == '' ? "($p->page_field)" : ''; echo "<h1 id='pw-content-title' class='uk-margin-remove-top'>$headline . " ($appendix)</h1>"; Then, I tried a Hook, but it alters the page->title and this doesnt fit my need here. wire()->addHookAfter('Pages::saveReady', function($event) { $page = $event->arguments('page'); if ($page->template != 'my_template') return; $page->of(false); $page->title = "\$page->title|\$headline - " . $page->page_field->title; $event->return = $page; }); I read about: Process::headline(), but can't figure out. Does Someone has an Suggestion, how I can extend/append the existing title (page edit) with tiny Text, just render? Thanks in Advance
    1 point
  9. The method you are looking for is headline. You could hook ProcessPageEdit:execute in a file like site/ready.php like described here. Adapt the template name in the following code to your needs: $wire->addHookAfter('ProcessPageEdit::execute', function (HookEvent $event) { $pageEdit = $event->object; $page = $pageEdit->getPage(); if ($page->template != 'shop') { return; // return early } $this->wire('processHeadline', 'My new headline'); // or modify the existing headline // $headline = $this->wire('processHeadline'); // $this->wire('processHeadline', $headline . " - " . date('d.m.Y', $page->created)); }); For easier finding and helping others in the future, I made a support post out of this:
    1 point
  10. Since I had to update more and more projects lately and also the PHP version of some of these projects was set to >=8 in the meantime I created a fork of the module and updated mPDF to version 8.1.3. With only some small changes in the WirePDF module I can now continue to use Pages2PDF without any restrictions. Maybe this is helpful for someone. https://github.com/markusthomas/Pages2Pdf
    1 point
  11. Hello @benbyf, You can update to the latest version of PW. If that doesn't solve the problem, convert the WebP images to a supported format like JPEG or PNG for admin use and for compressing them you can use any online application such as https://jpegcompressor.com/ it compresses JPEG, PNG and other.
    0 points
×
×
  • Create New...