Jump to content

elabx

Members
  • Posts

    1,496
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by elabx

  1. Try: $page->parent->get('menutext|title');
  2. Very interesting thread! I've had a couple people pretty amazed too by the volume PW can handle but this case is really interesting!
  3. Maybe some sort of server cache layer? Are you working local or on a server? Last but not least, the cache on your developer tools.
  4. I think this can actually be a good starting point overall. First, install a ProcessWire blank profile. If you do the file rename services.html -> site/templates/services.php, later you'll have to actually create the Template in ProcessWire, which automagically maps by name to a file by default. Say, template "services", matches to file "services.php". Actually if you add "services.php" to the site/templates folder and in the processwire interface try to create a new template, ProcessWire will suggest to create templates according to the existing files. After you do do this, you can go and recreate the pages in the page tree (assigning the right templates, to the right pages) you could end up with a "static" copy of your website. After this, you can think of adding the fields to the templates! This part involves a bit more, like installing the language modules, setting up the language fields, etc. But I could save that for later.
  5. wire()->addHookAfter('FieldtypeOptions::markupValue', function($e){ $page = $e->arguments(0); $e->return = $page->select_options_field->id; });
  6. Assuming that code is within a string, try: echo "<img src='{$repeater->field->url}'>";
  7. It happens to me on Runcloud which I think has basically the same scheme as Serverpilot.
  8. I've done this exact same path and it works really well with the bare minimum, check that doc page @szabesz sent. Stripe Checkout simplifies things a lot. FormBuilder seems to do this "plug and play" but I have honestly not tried it. The implementation of the checkout process is really minimal to get to the Checkout page if you want to remove FormBuilder from the equation, it ends up as very little code.
  9. Like @bernhard mentions I think Snipcart is a great option, I also feel depending on how simple the selling part is, you could use FormBuilder + Stripe.
  10. https://github.com/blue-tomato/TemplateEngineSmarty Check the last part of the docs, Extending Smarty, it has an example on how to register object/functions. If I understand correctly functions.php, the kind of functionality that it enables would translate on the hook system of ProcessWire. https://processwire.com/docs/modules/hooks/
  11. Nice work! Just heads up you left ProCache debug on!
  12. Is the profile going to be saved "outside" of the modal? And then you'll click Save on the profile page? Does the modal have some documentation? It probably has a save/close callback so you can then get the value of the modal form field and copy it to your main profile form. It seems a little strange to open up a modal to edit a text field, why not right there on the input? Obviously I might lack context.
  13. I'd go third party with this, I don't think there's anything similar to a forum "processwire native" aside from what @adrian mentions. I had once tested Vanilla Forums javascript integration and seemed super convenient as a plug and play solution. Although you get the overhead of hosting the forum software itself.
  14. Your user might have access permission restriction, do you have any another account passed on by the devs? A "superadmin" account is what you should be looking for so you have better access to logs and the whole system information.
  15. Do you see any errors on the log files? You can go on the top menu to Setup > Logs, and you can see if there are any errors there that might give a clue. Try uploading and checking if there are any recently updated log file.
  16. Awesome! Great to hear that! Sometimes you just have to stare at the code a bit of time until it clicks, keep on it! Let me know if I can help you with something else.
  17. contributions.template.name=mytemplate Maybe add the name subfield? Wild guesss only!
  18. elabx

    Webwaste

    Now I can send an article along: You're killing the planet with that 20mb video on the home page.
  19. On the Template Advanced tab you can set this option on "List of fields to display in the admin Page List" and write "{title}, {createdUser.name}"
  20. How are you doing your markup? You should have something like this: <input type="checkbox" name="color[]" value="red"> <input type="checkbox" name="color[]" value="blue"> Now color is an array: $selector = ""; $colorOptions = $sanitizer->array($input->get->color,'text'); if(count($colorOptions){ $colorOptions = implode('|',$colorOptions); $selector = ",color=$colorOptions"; }
  21. A bit like this. Fixed the initial template to singular "product", its the same idea I just like it better this way ? <?php //Default selector to get ALL products $selector = "template=product"; // Get color and size variables and sanitize $color = $input->get->text('color'); $size = $input->get->int('size'); // I changed the approach here to append the possible parameters to the selector string. if($color){ $selector = $selector .= ",color=$color"; } if($size){ // See how this uses greater than or equal to $selector = $selector .= ",size>=$size"; } // At this point, if you have both parameters for the search, you'll have a selector like this: // 'template=product,color=blue,size>=10' $products = $pages->find($selector); ?> <form action="."> <select name="color"> <option value="red">Red</option> </select> <input type="text" name="size"> </form> <div class="products"> <?php // Render the products list foreach($products as $product){ echo "<div>....</div>" } ?> </div>
  22. Well in this case I'd say each of your products would have a field per category. For example with the door's website: Max Price: Integer field DIN left or right: Select Options or Page Reference field (I'd use page reference) With glass: Checkbox field Width: Integer field Height: Integer field This would be template door, and child of a unique page with template doors. So in this scenario, since each product category has a different set of filters, I'd say each product has its own template, so you'd have templates: handles, door locks, door signs, accessories, each of them with its own set of fields. So you'd end up with a tree like: Products -- Doors --- Doors 1 --- Doors 2 -- Accesories --- Acc 1 --- Acc 2
  23. Yep, pretty much like that!
  24. What exactly do you need help with? The most common/straightforward way to do this is to grab and sanitize the GET variables from a form submission and use them to create a selector: <?php //Default selector to get ALL products $selector = "template=products"; // Get color variable and sanitize $color = $input->get->text('color'); if($color){ $selector = "template=products, color=$color"; } $products = $pages->find($selector); ?> <form action="."> <select name="color"> <option value="red">Red</option> </select> </form> <div class="products"> <?php // Render the products list foreach($products as $product){ echo "<div>....</div>" } ?> </div>
  25. I have been thinking about this but I feel the development overhead might not justify the switch at least where I'm standing. For example, what do I do with FormBuilder which is crucial? My clients love its flexibility and configuration.
×
×
  • Create New...