Jump to content

dotnetic

Members
  • Posts

    1,037
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by dotnetic

  1. 10.5 and 10.50 in terms of calculation is exactly the same. If you need this for output on the frontend side, then you could do a simple PHP number_format.
  2. You're doing a needless check, because your query already returned only pages with `in_evidenza=1` $in_evidenza = $page->in_evidenza; if($in_evidenza == 1) { Your code could be simplified (untested): wire()->addHookAfter('Pages::saveReady(template=articolo)', function($event) { $pages = $event->object; // this should also be not needed foreach($pages->findMany("in_evidenza=1") as $new) { $new->setAndSave('in_evidenza',0); } });
  3. Ok, I found one solution but I don't know if it is the smartest way: $('#pw-panel-shade', window.parent.document).click();
  4. Actually you can do this with a simple native JavaScript command inside the panel: window.parent.document.activeElement This returns the element that triggered the opening of the panel.
  5. @ryanI have an open pw-panel, and now I want to close itself via JavaScript from inside the panel. How would I do that?
  6. @Gabriel Uribe Take a look at the configuration of the typeahead script. There you find a setting "maxItem" where 8 seems to be default (not checked). Set it to 0 or false to display all results, or to the number you would like to display.
  7. You see that there is an error in strings.php: The view variable is not set, and you try to modify a property of an object that isn't there. The view variable is available after the TemplateEngineFactory module is loaded. And make sure that in the settings of TemplateEngineFactory "API variable to interact with the view" is set to "view". So maybe you have to change the load order when strings.php is included.
  8. @bernhard You still rock ? Thanks for this tip, this is also possible for PHPStorm, snippets are called Live Templates there. This is a great timesaver.
  9. @ryanIf you try to log in, if you want to change some information, then the form submit redirects to a wrong URL and you are not logged in.
  10. Hey @bernhard If you like, I would to share my experiences with Tabulator inside of PW (without using your module). I implemented working PW panel links inside the Tabulator, that update the table after changing a page (but the solution is not yet optimal) and virtual rendering and also grouping. I think these things would be great for RockTabulator. If you like to get some information, you can contact me on Skype. I do not have enough time to write a tutorial right now.
  11. Hi @bernhard. Maybe you'd like to update your code to the new syntax which awaits a ok and cancel function. See https://github.com/processwire/processwire/commit/63cba339e4cb942885d9702e9d9003539f1b8230 for the syntax.
  12. Yes, I thought about an addition. Right now it's a general purpose module, and a calculation result field would be an enhancement. Besides of that, I really like RockMarkup
  13. @dragan Sure, this is possible with a hook and thats how I do it now (without using RockMarkup). @bernhard It would be ideal, if RockMarkup could create an additional field on demand for saving the value (but then we should be able to select the options, like an integer with max 10 digits, for this hidden field), or if you could connect/link RockMarkup to an existing field, which has it's type and validation defined, because it is a regular ProcessWire field. So the result of a calculation would be saved in this field. Right now I just experimented with RockMarkup and it worked as expected, but saving the value is stopping me from using it right now for this purpose. But I think I will have other uses for it in the future.
  14. Can I save a value for the custom markup field and output it's value on the edit page? Right now I have a calculation field whose value is calculated via JavaScript (depending on other fields). But now on page save, I want to save the calculated value to the field, so I can possibly output it in a Lister Pro column. Is this possible or can you make it possible? I think this would be a cool addition, because you can use the value on pages/listers, where the other dependend fields are not available.
  15. I understand thats it's crucial to save bandwith. That's why we have webP now, finally. But there is one line in PagefileExtra.php that delivers the normal image url instead of the webp version, if the webp filesize is larger. In my case and I think on other sites too this is an unwanted behaviour, as quality and colors are different if you compare a jpg and a webp image. To illustrate this I attached this image, where you can see that the first three products which are being delivered as JPGs because the filesize is smaller are really different looking than the next 3 which are in webp format , especially in the logo area. This is somewhat hard to see here, but on my development site it looks really bad and is a showstopper for me to use webp. What I ask for is an option to skip the filesize check and maybe the option to enter a treshold value when to use the smaller image. I created a github issue "make the fallback optional if pagefile->url is smaller than webp" EDIT: This is already possible if you use following code: //_init.php // output webp version for all $image->url() calls, skip SVG's if($page->template != 'admin') { $wire->addHookAfter('Pageimage::url', function($event) { static $n = 0; if(++$n === 1) { if (strstr($event->object->filename, '.svg') === false){ $event->return = $event->object->webp()->url(false); } } $n--; }); }
  16. What exactly do you mean with adding it with the API? Do you mean a file upload? Do you mean output? I think you are mixing input/upload and output here?!
  17. Hey @Macrura I haven't tested "dynamic domains" because I don't use them, but the region setting for "EU" domain and also tracking for message open and clicks, which are working fine. I also committed another patch for strange display behaviour in outlook: https://github.com/chriswthomson/WireMailMailgun/pull/14
  18. Damn, I am very sorry. I mislead you. I thought it returns false, if the count fails, but it turns out, it really returns the number. Sorry. I updated my example above, which is basically the same as @Autofahrn's
  19. @elabx You are also correct with your statement, that integer 0 loosely evaluates to false. But as @Autofahrn said, the original poster @hollyvalero wants to work with the product array afterwards. But as my query does only return false or the integer number, that is not what he needs. So something like $products = $pages->find("template=news, limit=9, sort=sort" ); if($products->count > 3) { echo $products->each(function($product) { return "<p>$product->title</p>"; }); } would be correct
  20. Even shorter: $products = $pages->find("template=product, limit=9, sort=sort")->count(3); if ($products) d($products);
  21. @nbcommunication Thanks for your work on this module. Maybe @Macrura could merge your latest changes? Would you create a pull request for this? As far as I can see everything is working fine here. I use this module in conjunction with @ryan's ProMailer module to send out newsletters. I even used the tags method, to enable analytics.
×
×
  • Create New...