Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Posts posted by maxf5

  1. You have to make the ajax call with the url .. not the template file.
    Make sure you have created a page with that template.

    $.post('ajax.inc', function(e) {});

    $.post('/path-to-ajax-page', function(e) {});


    Ajax Template

    from different db:

    $mydb = new Database('host', 'username', 'password', 'db');
    $result = $mydb->query("SELECT * FROM example");

    from pw db:

    $query = $database->prepare("SELECT id, name FROM pages LIMIT 10");
    $result = $database->execute($query);

    Your js

                    type: "GET",
                    url: "/path-to-ajax-template",
                    success : function(data){
                        var markup = $(data).find('#result');


    • Like 4

  2. Pass it to an associative array (not tested):

    <?php namespace ProcessWire;
    function processNewPerson(WireArray $data) {
        $u = new Page();    
        $u->template = "person";
        $u->parent = $pages->get("/people/");
        $u->first_name = $data["first_name"];
        $u->last_name  = $data["last_name"];
        $u->full_name = $data["first_name"] . " " . $data["last_name"];
        $u->city  = $data["city"];
        $u->name = $sanitizer->pageName($u->full_name, true);
    if($input->post["submit"]) {
        $data = WireArray::new([
            "first_name" => $sanitizer->text($input->post['first_name']),
            "last_name" => $sanitizer->text($input->post['last_name']),
            "city" => $sanitizer->text($input->post['city'])
        $people = $pages->find("template=person, first_name=$data['first_name'], last_name=$data['last_name']");
        if($people->count === 0) processNewPerson($data);


  3. On 7/19/2018 at 10:46 AM, alejandro said:


    I'm having the Select button disappearing, so I can't select anything. Is there a fix for this issue?

    I'm using last version of the module.



    Here is a little fix:

    In your templates/admin.php add a custom css file:

    $config->styles->add($config->urls->templates . "styles/admin.css");
    require($config->paths->adminTemplates . 'controller.php'); 

    in templates/styles/admin.css

    .PageList .PageListItem:hover .PageListActions {
        display: inline-block !important;

  4. You can make it this way, so you don't need two loops and the high res will be first in the array.

    $available_flavors = $pages->get(1017)->children("sort=-is_high_res_image");
    <div class="row">
      {% for flavor in available_flavors %}
      <div class="col-sm d-flex flex-column">
        <div class="shishaFlavor align-self-center"
             style="background-image: url('{{ flavor.shisha_flavor_image.url }}')">
        <h3>{{ flavor.title }}</h3>
      {% endfor %}


  5. You can create roles in ProcessWire. For example GuestsA, GuestsB, GuestsC and easily get 'em via Api.

    // Get them
    $usersA = $users->find("roles=GuestA");
    // Check them


    Also you can create custom fields inside the user-"pages".
    So you could create a selectfield which you can set with a hook after registration.



    • Like 2

  6. Hi guys,

    this just came into my mind if you have MarkUpCache / TemplateCache enabled.

    Is there a more elegant way than using a http request?

    in site/ready.php:

    <?php namespace ProcessWire;
    function PreLoadCache(HookEvent $e) {
        $all = wire()->pages->find("has_parent!=2|1139|1029"); // no admin pages, contact forms, page tables
        $s=0; $f=0; $fn = '';
        $http = new WireHttp();
        foreach($all as $a) {
            $response = $http->get($a->httpUrl);
            if($response !== false) {
            } else {
                $fn .= $a->title . ", ";
        wire()->log()->save('croncaching', 'Cached: '. $s .' Pages, Failed at '. $f .' Pages: '. $fn .'');
    wire()->addHook('LazyCron::every12Hours', null, 'PreLoadCache');


  7. 42 minutes ago, pwired said:

    How are all the different drivers for all the hardware stored and made available for download ?

    There is a stand-alone Zend application made only for all the drivers and documents. I just connect to the database and get the informations with a few queries.

    • Like 1

  8. New website for Nexoc GmbH in Munich, Germany.

    NEXOC. GmbH was founded in August 2003 and sells notebooks and PCs under the NEXOC brand name. The products are characterised by a particularly beautiful design and high quality and are available at an attractive price-performance ratio. We spell Individuality with a capital I! Each notebook and each PC from NEXOC. can be individually configured and designed in line with customer wishes and requirements - there is no challenge - there are only solutions, and these are what NEXOC. offers!

    Page-Builder done with PageTable
    Download Center: getting the informations from the database of an external application, caching the resultes with WireCache and show the results via Ajax
    frontend login for reseller

    jQuery Lazy

    Upgrades Checker
    Simple Contact Form
    Schedule Pages
    Email Obfuscation
    Range Slider
    Image Extra
    Tracy Debugger
    PageTable Extra Actions

    Some "behind the scenes":









    • Like 11
  • Create New...