Jump to content

Nicolas

Members
  • Posts

    95
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Nicolas

  1. On 3/19/2024 at 9:52 PM, wbmnfktr said:

    I would use sort=sort in the selector string here - as you already do.

    It should work without issues unless you have some sort settings applied in individual templates.
    Maybe in some other part of your code you mix things up again.

    That $view->top_categories can't be the whole code.
    Is that Twig you are using? Are there additional checks or queries?

    Hi @wbmnfktrThanks for your answer.
    I'm indeed using the TemplateEngineLatte module, but I think my issue is more related to the point mentionned by @BillH regarding the "sort=sort" parameter nested pages.

    I ended up adopting a recursive approach to solve my problem as shown below :

    <?php
    // In init.php
    
    $catalogue_root = $pages->get(1027);
    
    
    $view->categories = getOrderedCategories($catalogue_root->id);
    
    function getOrderedCategories($current_category_id, &$categories = []) {
      
        $current_categories = wire()->pages->get($current_category_id)->children('template=category');
    
        foreach($current_categories as $category) {
            $categories[] = $category; // populate the reponse with category page object
            getOrderedCategories($category->id, $categories); // proceed with sub categories
        }
      
        return $categories;
    
    }

     

    • Like 2
  2. Hi,

    I need to make a filter sidebar for a catalogue displayed in a tree like fashion. To get the list of the catalogue root page i've the the following

    $view->top_categories = $pages->get(1027)->descendants('template=category, sort=sort');

    In the category template the children a sorted by 'None'.

    What would be the right selector to display the tree like filter with the categories sorted in the same order as the pages in the admin section ?

    catalogue-pages.jpg

    catalogue-filter.jpg

  3. Hello Webjack,

    Great writeup on ProcessWire from a beginner point of view.

    A quick note : in the breadcrumb ProcessWire is spelled wrongly. It should be ProcessWire whithout a dash (-).

     

    Glad to see you're enjoying ProcesWire while dicovering it and learning english at the same time.

    Merry Christmas !!

    • Like 1
  4. Welcome on board Webjack !!
    Bienvenue dans la communauté ProcessWire.
    De mon expérience, ProcessWire est en effet un CMS orienté développeur. Pour cette cible c'est un outil très agréable et efficace grâce notamment à son API.

    Comme indiqué sur la page d'accueil, il est simple à utilisé pour les clients. Pour les créateurs de site il est indispensable d'avoir un minimum de connaissance de PHP. Cela dit entre la documentation qui est très bien faite et le support de la communauté sur le forum, on peut rapidement progresser.

     

    22 hours ago, Webjack said:

    How far would I go?

    As far as you can imagine 😉

    • Like 2
  5. Hi,

    I wanted to give Wireframe a shot with the Latte renderer but can't get it to work. The layouts/default.latte template does'nt seem to load the views/home/default.latte

    I'm using the ProcessWire 3.0.228 with PHP 8.2. and both Wireframe and WireframeRendererLatte have been installed via ProcessWire (not with Composer).

    What am i doing wrong ?

    Capture d’écran 2023-09-28 à 10.17.44.jpg

  6. Had a looked at Drupal 7, was scared by what I've seen and leaved it in a closet since then. A few years later I'm tempted to give v10 a try since Drupal now use a lot of Symfony components.
    Would you provide us a debrief coming back from the conférence ?

    • Like 1
  7. On 4/30/2023 at 8:16 AM, Sara said:

    Is a good module overall, I purposely obmitted the name but-- I am still using it, so no problem beside that it will leave out the icons associated with my templates. There is a way to give the information directly to you instead of publicly?

    Can you contact the module's author or maintener or raise an issue on Github ?

  8. 3 hours ago, kongondo said:

    By the way, I could have offered to take lead on this but until a certain module is released (getting very close now! ?), I don't have much time for anything else ?.

    Hummm ... are you talking of the module one should not say the name ? Happy to know it's getting close to be released as the last sneak peek video got me really excited about Padlopper 2.

    • Like 1
  9. On 1/22/2021 at 8:43 PM, kongondo said:

    Definitely ?. This was for demo purposes only. My plan is to develop my own using Affinity Designer...at least the easier ones. However, I don't know how much different I could make them look compared to YOOTheme's. 

    Thanks. Will have a look.

     

    By the way, I have been keeping an eye on this one:

    https://heroicons.com/  ...by the folks at TailwindCSS

    This iconset might be of interest for you as well : https://tablericons.com/

    • Like 3
  10. 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
    }


     

×
×
  • Create New...