Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/23/2019 in all areas

  1. Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild. EDIT: You can now install it directly from the Modules directory: http://modules.processwire.com/modules/inputfield-float-range/ What is it? The missing range slider Inputfield for Processwire. What does it do? This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates. It includes a visible and editable value field, to override/tweak the value if required. Features Min/max values Precision (number of decimals) Optional step value (Read more) Optional manual override of the selected value (will still adhere to the rules above) Configurable rounding of manually entered values (floor, round, ceil, disable) Usage Clone / zip repo Install FieldtypeFloatRange, this automatically installs the Inputfield Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field. To render the field's value simply echo `$page->field` Demo A field with Min=0, Max=1, Step=0.2, Precision=2 Field with settings Min=0, Max=200, Step=0.25, Precision=2 Todo Make the display-field's size configurable (will use the Input Size field setting) Hopefully become redundant Changelog 008 (current version) - Add composer.json and submit to Packagist, making the module installable via composer 007 - Add defaultValue field (as requested by @charger) - Fix a silly mistake where a negative rounding (-1) resulted in removing all decimals instead 006 - Fix bug where InputfieldFloat negative precision prevented the displayed value to be updated properly - Revert installs & requires, so direct installs from Modules Directory (should) work 005 - Fix bug where the Inputfield would not work properly within repeaters / repeater matrices 004 - Make rounding of manually entered values configurable (floor, round, ceil or disable) - Fix small JS bug where the value-display field was not displayed - Update README 003 - Code cleanup, add some ModuleInfo data & LICENSE - Submit to PW Modules directory (http://modules.processwire.com/modules/inputfield-float-range/) 002 - Fix issue where setting the step value to an empty value created problem with validation - Make the display-field optional 001 - Initial release Thanks!
    1 point
  2. Working for me now with no changes other than a restart of Mamp Pro. Might be unrelated.
    1 point
  3. Equally OT, but it sounds like this could result in unwanted consequences: PagePathHistory hooks into ProcessPageView::pageNotFound, so initially it only knows that a Page is missing. If it doesn't have a record for that exact URL, the most straightforward approach for supporting URL segments (as you've suggested) would mean that it needs to recurse through the path and see if it can find a record for a partial match for a Page that has URL segments enabled (which is getting somewhat complex, and creates a bit of overhead), and – since ProcessWire can't really know for sure which segments are available, let alone were available in the past – it would probably just have to assume that anything goes. In addition to the overhead and general unreliability, it also sounds like this could create redirects for URLs that should just throw a 404, and we'd also have some new questions: is it enough to check if the target page currently has URL segments active, or should we assume that this may have changed as well? What about the redirect – is it enough (i.e. helpful) to redirect to the parent page, or should it attempt to redirect to an URL segment on that page? If we do that and it fails, what next? All in all I can see a number of potential gotchas here, so not supporting URL segments seems like a reasonable decision. They are "virtual paths", and PagePathHistory is for real paths ?
    1 point
  4. I found a solution which works: //users current language is for example: german // language "default" is english $key = "lorem_ipsum"; $string = __($key, "path/to/my/textdomain.php"); if($key == $string && wire('user')->language->name != "default") { wire('languages')->setLanguage('default'); $string = __($key, "path/to/my/textdomain.php"); wire('languages')->unsetLanguage(); } echo $string;
    1 point
  5. If you allow the user to select one or more products, you can use a select field to present the options to the user. Of course it depends on the number of available products. If there are a large number of products, you may want to separate them by category. The select field's options allow for values that you require.
    1 point
  6. Thank you, Pixrael! That got me to the solution! $loadLogo = $getKV->exhibitor_logo; $logoresize = $loadLogo->pim2Load('ig')->canvas(1600,895,array(0, 0, 0, 0),'c',0)->setOutputFormat("png")->pimSave()->httpUrl; $exlogo = $logoresize; $filename = $getKV->name . "_instagram.png"; $background = "https://domain.com/site/templates/images/Exhibitor-Graphic-BG-Platinum.jpg"; $logo = file_get_contents("$exlogo"); $bg = file_get_contents("$background"); $im = new \Imagick(); $im->readImageBlob($bg); $im2 = new \Imagick(); $im2->readImageBlob($logo); $im->compositeImage($im2, \Imagick::COMPOSITE_ATOP, 100, 350); $im->setImageFormat("png24"); $im->scaleImage(1024, 1024, true); $im->writeImage("../downloads/$filename"); $im->clear(); $im->destroy(); $file = "https://domain.com/site/downloads/$filename"; echo "<img src='$file' alt='$getKV->name' />"; Now I just need to bring in the code to start with a different background graphic based on the order history in Padloper. In THEORY, I'm almost there! ? Thanks so much for your help!
    1 point
  7. This helped me out, thanks. Reviving the topic because I wanted ask if anyone found a decent way to include protocol and domain by default, to all internal links added with CK Editor. Thanks!
    1 point
  8. Exactly. It's just a bit custom CSS. ? It might also be an idea for a matrix update that you can configure labels as images. Would be more flexible.
    1 point
×
×
  • Create New...