Jump to content

maxf5

Members
  • Posts

    143
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by maxf5

  1. Ok, the Lazy.Cron.cache was guilty ;)

    it's working fine now, thank you @abdus!

    you just have to put: enddate<now for the closables ---  startdate<now, enddate>now for the openables

    wire()->addHookAfter('LazyCron::every30Minutes', function (HookEvent $e) {
    
      $closables = $e->pages->find("closed=0, enddate<now");
      foreach ($closables as $p) $p->setAndSave('closed', 1);
    
      $openables = $e->pages->find("closed=1, startdate<now, enddate>now");
      foreach ($openables as $p) $p->setAndSave('closed', 0);
    
    });

     

    • Like 1
  2. hey @abdus

    that's a great hint!

    I installed LazyCron and made the /site/ready.php

    <?php namespace ProcessWire;
    
      wire()->addHookAfter('LazyCron::every30Seconds', function (HookEvent $e) {
          $test = $e->pages->get('id=1');
          $test->setAndSave('footerhide',1);
          $test->setAndSave('meta_desc','123');
      });

    .. for testing and nothing happens. In tracy debugger ($test->setAndSave('meta_desc','123');) it works fine..

  3. Hey guys,

    i have some sort of events/campaigns which have a lifespan. To deactivate them i made a checkbox-field called closed and i have to deactivate them manually.
    I would like to put two fields in the template, startdate and enddate, which activate/deactivate that checkbox field automatically.

    Dou you have any idea how to bring that on the run?

  4. 		if($item->hasChildren() && $maxDepth) {
    			$out .= '<div class="w3-block w3-padding w3-white w3-left-align accordion">';
    			$out .= $item->title;
    			$out .= ' <i class="fa fa-caret-down"></i></div>';
    			if ( $item->id == wire('page')->id ) {
    				$out .= '<div class="w3-bar-block w3-padding-large w3-medium">';
    			} else {
    				$out .= '<div class="w3-bar-block w3-hide w3-padding-large w3-medium">';
    			}	
     			$out .= renderNavTree($item->children, $maxDepth-1);
     			$out .= '</div>';
    		}
    		else {
    			// markup for the link
    			$out .= "<a href='$item->url' class='w3-bar-item w3-button w3-opacity-min'>$item->title</a>";
    		}

     

    Quick & Dirty. Can you try this one?

    • Like 1
  5. Uff, after a few weeks i have a problem with the checkboxes in the form.
    They 're not required, but the user can't send the form when not checked.

    Anyone with same problems?

    Iam using two different forms on my website (different pages) which haven't the same fields,
    i set the fields for the particular form with:

    $options = array(
      'allFields' => 'sfc_tel,scf_fax,scf_email,scf_subject,scf_message,scf_haendlerwerden',
      ..
    );

    scf_haendlerwerden is a checkbox, not-required. 
    Is that where the error comes from, selecting the fields via $options["allFields"] ?

    ProcessWire 3.0.75

  6. 8 hours ago, Mike Rockett said:

    Home Page default language name

    sitemap02.jpeg.de30965b3f9cc18fa473ef1b86799ba0.jpeg

     

    Hi @Mike Rockett, i knew that "trick". But i don't want my default language urls (german/de) look like: sample.de/de/contact,
    or is there any option to remove that url segment of the default language in the url when having a default language name in "Home > Settings"?

     

    EDIT: Ah forget it, i just updated the module to version 0.20 and saw "ISO code for default language" :rolleyes::rolleyes:

    • Like 1
  7. Hi @Wanze, files are there on the ftp in /site/assets/files/{pageid} - also the thumbs are generated correctly.

    2017-09-15 10:51:35	xxx_usr	http://xxx.de/?pages2pdf=1048	IMagick Resized: captiva_sharkoon_0127-big.jpg => captiva_sharkoon_0127-big.220x220.jpg (220x220) 0.2990 secs 953844 => 14251 bytes (quality=90, sharpening=soft)
    2017-09-15 10:51:35	xxx_usr	http://xxx.de/?pages2pdf=1048	IMagick Resized: captiva_sharkoon_58-big.jpg => captiva_sharkoon_58-big.220x220.jpg (220x220) 0.2852 secs 814741 => 13240 bytes (quality=90, sharpening=soft)
    2017-09-15 10:51:35	xxx_usr	http://xxx.de/?pages2pdf=1048	IMagick Resized: captiva_sharkoon_0083-big.jpg => captiva_sharkoon_0083-big.220x220.jpg (220x220) 0.3268 secs 1532518 => 8103 bytes (quality=90, sharpening=soft)
    2017-09-15 10:51:36	xxx_usr	http://xxx.de/?pages2pdf=1048	IMagick Resized: captiva_sharkoon_0103-big.jpg => captiva_sharkoon_0103-big.220x220.jpg (220x220) 0.3187 secs 2139397 => 31538 bytes (quality=90, sharpening=soft)


    using ProcessWire 3.0.73, any known bugs here?

  8. Hi bernhard,

    thank you for the hint.  The image field is set as single element.
     

      <td colspan="1" style="padding:15px">
        <img src="<?= $page->navimg->url; ?>" width="220"/>
        <p><?= $page->navimg->url ?></p>
      </td>
    
    something between ..
    
    <?php if ($page->images->count > 0) : ?>
    <table>
      <tr>
      <?php
        $gallery = $page->images;
        $gallery = $gallery->slice(0,4);
       foreach ($gallery as $image): ?>
        <td>
          <img src="<?= $image->size(200, 200)->url ?>" width="200" height="200"/>
        </td>
      <?php endforeach; ?>
      </tr>
    </table>
    <?php endif; ?>

     

    template part:

    <?php 
    $optionspdf = array(
      'title' => 'Datenblatt',
      'markup' => '<a class="uk-button gaming" href="{url}" download>{title}</a>',
      'pageFormat' => 'A4'
    );
    echo $modules->get('Pages2Pdf')->render($optionspdf);
    ?>

     

    result:

    Unbenannt.thumb.PNG.434147903301c5d7a1ddea668fee6fee.PNG

     

  9. Maybe @ryan can "share jobs" to the community much more that we can help.

    I think these points are outdated and had to be done first:
    a) default admin theme -  it will pay more attention to people who are making the first steps into PW
    b) new branding/ci for PW. these identity now with the skyscrapers on facebook is looking so 90ties..
    c) like @apeisa said, a new stylish/modern PW website. A powerful start-page showing the features. ( of course also updated docs, tuts,..)

    thinking of a clean design like pagekit ( https://pagekit.com )

     

    • Like 1
  10. Maybe one can make optional module settings for this problem.
    Listing every language used on the website and a field for the ISO and a checkbox.
    When checked it renders the "custom" ISO for this language.
    
    
    • Like 1
  11. $latest = $users->find('roles=anzeigen-anbieter, sort=-customer_number, limit=1');
    $newnumber = $latest->customer_number + 1;
    
    $user = new User();
    $user->of(false);
    $user->name = "Paul";
    $user->pass = "max123";
    $user->email = $email;
    
    $user->customer_number = $newnumber;
    
    $user->addRole("anzeigen-anbieter");
    $user->save();

     

    • Like 3
×
×
  • Create New...