Karl_T

Members
  • Content count

    100
  • Joined

  • Last visited

Community Reputation

43 Excellent

About Karl_T

  • Rank
    Sr. Member

Contact Methods

  • Website URL
    karl.tai.dev@gmail.com

Profile Information

  • Gender
    Male

Recent Profile Visitors

937 profile views
  1. Thanks for this great tutorial! I am impressed by your PW admin UI manipulation skill all time. This tutorial could definitely get someone's hands dirty. Yes it is really quite hard imo because the related information is not easy to find. They do exist but always sit inside various post replies. It just looks like a missing piece to beginners. I long for a more in-depth version of this tutorial, or a complete guide precisely, that shows how to accurately use wiretab, pw-modal, panel, buttons etc. and layout all of them properly. I discovered a bit from reading through the core files and modules by trial and error but I believe I still have a long long way to go. I believe many people, like me a while ago, stuck in the layout phase and then give up their modules development.
  2. I had the same wonder a while ago. You may take a look at Ryan's reply here: https://github.com/processwire/processwire-issues/issues/224
  3. Hi there. I have encounter another issue that what ever I change the sharpen and quality during cropping, the sharpen and quality are always showing soft and 90 respectively after confirm the crop. The resulting images are the same too, so it is simply not a display issue.
  4. This is the first time I encounter this issue. Thanks for the tip for fixing it.
  5. Thanks for this great module! I am finding responsive image solutions and then I luckily come here. I have encountered an issue after I install the module. I tried to change the inputfield type of an existing image field to croppable image3. The croppable image3 specific crop setting is not there after switching. So, in the edit, it is just look the same as the normal image field. Sorry if it has been reported before as I did not read all replies one by one.
  6. You could use pw-append on sidebar in template when it is needed instead of putting it inside _main.php. In _main.php <div id="main"> FULL WIDTH OR SIDEBAR IN HERE </div> Inside some-template.php <div id='sidebar' pw-append='main'></div>
  7. Hi @kixe, I found that single select is not working. I have fixed the issue based on your files. I forked the original repo here: Github
  8. There is another related bug. If you have more than one image fields, you will see the image all in the same size even you have adjust the size bar individually after you save and refresh.
  9. Recently I am fixing this issue, again, and I find this post in google. There's another solution that I found in the ListerPro forum before. The created, modified, publish date format can be changed via language translation. The language support module has to be installed in this case. Go to Setting > Language > choose the language you use > Click Find Files to Translate button > click /wire\modules\Process\ProcessPageLister\ProcessPageLister.module and submit > translate "rel" field(should be listed on top) to wanted format like Y-m-d Reference: https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/wire/modules/Process/ProcessPageLister/ProcessPageLister.module#L238
  10. I have find the solution, but in an ugly way. You may find the code in github.
  11. Ya, you are right. Thanks for pointing this out!
  12. Thanks for letting me know your great module. The module is really handy and fit for many use case. I have waited long to see excel like inputfield like this one as I do not have the ability to make one as I am not good at database. The case I encounter is that I need the permission control over the price for different country. I think it would be the best to make the field multi-language enabled. Below is the update. Only default language is saved correctly, while other languages are still null if I saved any value into them. The issue is that the sanitizeValue() input $value is always null for other languages, while sleepValue() $value is good. I cannot find where the value get removed. <?php namespace ProcessWire; require_once(wire('config')->paths->root . 'wire/modules/LanguageSupport/FieldtypeLanguageInterface.php'); /** * Multi-language capable float field * * ProcessWire 3.x, Copyright 2016 by Ryan Cramer * https://processwire.com * * */ class FieldtypeFloatLanguage extends FieldtypeFloat implements FieldtypeLanguageInterface { public static function getModuleInfo() { return array( 'title' => 'Float (Multi-language)', 'version' => 0, 'summary' => 'Field that stores a floating point (decimal) number in multiple languages', 'permanent' => false, 'requires' => array('LanguageSupportFields'), ); } /** * Sanitize value for storage * * @param Page $page * @param Field $field * @param LanguagesValueInterface|float $value * @return LanguagesPageFieldValue * */ public function sanitizeValue(Page $page, Field $field, $value) { foreach($value as $languageName => $languageValue) { $languageName = $this->wire('languages')->get($languageName)->name; if(!strlen("$languageValue")) $value->$languageName = ''; if(!is_float($languageValue) && !is_int($languageValue)) { $value->$languageName = $this->wire('sanitizer')->float((string) $languageValue, array('blankValue' => '')); } if(is_null($field->precision)) { $value->$languageName = (float) $languageValue; } else { $value->$languageName = round((float) $languageValue, $field->precision); } } return $value; } /** * Return the database schema in specified format * * @param Field $field * @return array * */ public function getDatabaseSchema(Field $field) { $schema = parent::getDatabaseSchema($field); $languageSupport = $this->wire('modules')->get('LanguageSupport'); foreach($languageSupport->otherLanguagePageIDs as $languageID) { $schema['data' . $languageID] = 'float'; $schema['keys']["data{$languageID}"] = "KEY `data{$languageID}` (`data{$languageID}`)"; } return $schema; } /** * Format value for output, basically typecasting to a float and sending to textformatters from FieldtypeFloat * * @param Page $page * @param Field $field * @param LanguagesValueInterface|float $value * @return float * */ public function sleepValue(Page $page, Field $field, $value) { $precision = $field->precision; foreach($value as $languageName => $languageValue) { $languageName = $this->wire('languages')->get($languageName)->name; if(is_null($precision)) $precision = self::getPrecision($languageValue); if(!is_string($languageValue)) $value->languageName = number_format($languageValue, $precision, '.', ''); } return $value; } }
  13. I am currently cloning core text language field into float field as I want to use the multi-language function as a multinational solution. I am using the float field as price field, since the price is different for different country(language). Below is my trial, unfortunately a failed one. Any value will be saved as zero or null in database. I would like some advises on this. Thanks. EDIT: please ignore the below code. Updated code has been posted in reply
  14. Wow, this is exactly what I am looking for. Great thanks!
  15. Currently the page tree(name=page) under admin is locked. I would like to generate a page to place above the page tree, using $page->sort = 0, but it is not possible before removing the statusSystemOverride attached to it. I tried to remove the status like this: $pages = $this->wire('pages'); $tree = $pages->get('name=page, template=admin'); $tree->removeStatus(Page::statusSystemOverride); $tree->save(); And recover the status after saving my generated page $p = new Page(); $p->template = 'admin'; $p->title = 'Some Page'; $p->name = 'somepage'; $p->parent = $pages->get(2); $p->process = 'SomeProcess'; $p->sort = 0; $p->save(); $tree->addStatus(Page::statusSystemOverride); $tree->save(); And the Page group is disappeared on the sidebar. I cannot recover it and need to reinstall the PW. I am developing a module so I would like to know the correct way to place page above the page tree by API not by drag and drop. Thanks.