Jump to content

Nicolas

Members
  • Posts

    97
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Nicolas

  1. Hi,

    For a project I need to add a custom admin action button. Tanks to @bernhard i was able to add the action in the submit button dropdown.

    To peform the action i'm adding a hook to the InputfieldSubmit::processInput method, however the function is executed twice for some reasons i can't figure out.

    What am i doing wrong  ?

     

    <?php
    // Add a save action button to resend the registration email
    $wire->addHookAfter('ProcessPageEdit::getSubmitActions', function(HookEvent $event) {
        $actions = $event->return;
        $actions['send_registration'] = [
            'value' => 'send_registration',
            'icon' => 'check',
            'label' => '%s + Resend registration email',
        ];
        $event->return = $actions;
    });
    
    // Process custom save button action
    wire()->addHookAfter('InputfieldSubmit::processInput', null, 'send_registration_email');
    function send_registration_email($event) {
      $input = $event->arguments(0);
    
      if('send_registration' === $input->_after_submit_action) {
          // populate  email vars here
        send_email($input->email, $mail_subject, $mail_body, wireMail());
    
      }
      // Populate back return value, if you have modified it
      // $event->return = $attendee;
      $event->cancelHooks = true;
    };
    
    function send_email($email, $mail_subject, $mail_body, $mailer) {
        // Sends the email
    }


     

  2. On 1/29/2020 at 12:08 PM, kongondo said:

    Hmm. This is a tricky one as it is made up of two parts:

    1. Paying a fraction (instalment) of the total cost
    2. Future payment (aka recurring payment)

    Both are tricky, but especially #2. 

    #1 is partly achievable by raising an invoice using manual order creation. The order will be manually marked as complete once the total has been paid. Automating the process may not be an easy task. I'd have to think about it more.

     

    # 2 If this means storing user card details, then no; we are not going down that route. However, if it means using payment providers' subscription/recurring payments services, then it is probably doable. The payment providers API is there. Something else to think about, but for future versions.

    Currently none of these features are in the plan, but I'll have a think. I will probably need reminding though :-).

    Thanks for your answers.

    #2 Totally agree about not storing user card details.

    I guess that the "easiest" path will be to have a module around a provider like Stripe, ReCharge etc...

  3. On 8/12/2019 at 8:19 PM, Zeka said:

    Definitely, I would recommend PW.

    In my case, the client didn't like the tree structure of pages, so I had to create separate Process modules for managing news, tags, banners, categories. I have found that it's much easier to control permissions and workflow via custom modules.

    chrome_RXeVFNQZPO.png

    Hi Zeka, I was wondering how easy/difficult it has been to style the back office to black & white theme ? Any hints on how you achieved that ?

    • Like 1
  4. 1 minute ago, wbmnfktr said:

    There are so many ways in ProcessWire to do or save things.

    Depending on your background and history with ProcessWire you will find other ways or solutions.

    I know recipe-collectors that would only need two fields. A title and a textarea.

    I personally would go a more abstract way to be able to much more and other things.

    • Template: Recipe
      • Fields:
        • title (text)
        • summary/introduction (textarea)
        • preparation (textarea)
        • ingredients (repeater)
          • Fields:
            • ingredient (page reference - pages with template ingredient)
            • amount (int or text)
            • unit (select options - grams, cups, liters, hint)
        • images (image)
    • Template: Ingredient
      • Fields:
        • title

    With that setup I can easily collect all my recipes, create a list of all ingredients I need for all of my recipes. Can look for recipes with a special ingredient and so on.

    +1 for the ingredient template allowing to create a ingredient database.

    • Like 1
  5. Hi,

    From the top of my head this could do it this way :

    a template with a title and body (recipe) field and a repeater field to hold the ingredients list :

    a text field to hold the ingredient name

    a text field to hold the amount of ingredient

    a select field to hold the amount unit (tsp, l, ml? etc..)

    • Like 1
  6. Bravo ? !!

     

    I'm thinking about using ProcessWire as a foundation for a marketplace. Glad to see ProcessWire works very well for you.

    Without selling your company's trade secret it would be great to get some insights about how you use ProcessWire.

     

    • Like 1
  7. On 10/01/2018 at 6:20 AM, tpr said:

    No, things are not that obvious.  We are using other tools that allow separating admin and frontend to different servers,  so even if fronted gets hacked they can't get hold of sensitive data but only static html files. This is something pw can't do afaik,  perhaps with procache but I haven't tried that workaround so far. 

    Can you elaborate on "other tools that allow separating admin and frontend to different servers". Do you mean tools like Gatsby and the likes ?

  8. 3 hours ago, szabesz said:

    Try turning off AJAX for the repeater: "Repeater dynamic loading (AJAX) in editor"

    Currently, there are a few Repeater related issues reported at the github repo: https://github.com/processwire/processwire-issues/issues but yours seems to be unrelated.

    Do you happen to have any modules/code that might interfere (via hooks) with the save operation? The error message says that OutputFormatting had been left "on" (true), and probably it is not a bug in the core, I guess.

    No luck by turning off the dynamic loading.

  9. What i want to achieve is to be able to add an remove pages from the repeater fields.

    When saving the page holding the repeater field on creation everything work as expected, but later on when updating any field in the repeater the changes are not save and an error occurs.

    My version of ProcessWire version 3.0.36.

    • Like 1
  10. 33 minutes ago, Guy Verville said:

    I don't mind paying $80 on a $60000 project, specially if I can get a swift support. I was just pointing some direction. As of sharing same issues, I can't talk about it right now. The main concern is not just the URL redirection, but the permissions associated with a subdomain.

    My client asks that a role associated to a subdomain must be able to just edit the pages of that subdomain. There will be 10 subdomains (this is an international site with 10 region subdomains, sharing a lot of information in each site, but having also regional particularities. The only differences as for the templates will be the colour identifying the region). So far, in my understanding of PW, roles permission are template based (or user based with one of Ryan's module). I have seen a Page per role permission module, but it seems not ready for PW3. It's certainly doable to make some coding here to prevent edit pages (from the admin interface, since everybody will see the tree of the organisation).

    In Concrete5 you can set permissions to a specific page in a tree and tells that the children share those permissions.

    Anyway, Concrete5 and MODx are fine CMS, but I would like to stick to PW if I can, :-) , because the easiness of rendering and searching things, etc.

     

    Just a final note. I'm not a program, but I'm part of a team with programmers. Programming things is not the problem. I am responsible to find the right solution for the project.

    Hi, i haven't used ProcessWire in a multisite context but have already used the Admin Restrict Branch module to limit  to a given subpages set of theProcessWire page tree.

    • Like 1
  11. In the latte file i've got the following code

    <div class="entry-main">
      <h3 class="entry-title ui-title-inner">{$page->title|noescape}</h3>
      <div class="entry-content">
        {$page->body|noescape}
      </div>
    </div>

    The body field is configured to process Hanna Code as a text formatter

  12. @adrian Already tried that but whatever the open and close tag choosen, Latte template will try to load the file with the name of the code. For example i have a Hanna code named "quote". Then i've got the following this error : Error: Exception: Missing template file '/Volumes/DATA/www/ceea/site/templates/views/quote.latte'

×
×
  • Create New...