Jump to content

kixe

Members
  • Posts

    806
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by kixe

  1. If $widget is a page object it should be possible to put outputformatting on just to grab the value and switch it of after. If not you can use the formatValue() function from the module. You need a page and a field object as arguments. $page can be any page in this case but $field should be the one where the OF type is stored. $FieldtypeColor = wire('modules')->get('FieldtypeColor'); $field = new Field(); $unformattedColor = "ff5a01fd"; $page = new Page(); $field->type = $FieldtypeColor; $field->outputFormat = 0; $color = $FieldtypeColor->formatValue($page,$field,$unformattedColor); var_dump($color); // string(7) "#5a01fd"
  2. @Macrura Page output formatting? $page->of(false); var_dump($page->color); // string(8) "ff5a01fd" $page->of(true); var_dump($page->color); // string(7) "#5a01fd"
  3. If you need a quick solution try in config.php ini_set('memory_limit', '-1'); // unlimit memory
  4. I have a similar module in use. For security reasons I verify if only one single user has the login email address in use. Emails aren't unique in PW like user names! Furthermore its useful to log login failures. Keep the ProcessWire Login Process safe!
  5. @rafaoski thanks for the video. Unfortunately I cannot reproduce. Could you check if the value is changed in the database? It looks like the setting is falling back to a previous default value. Could you unset the default value and try again? I made a screenshop of the fieldsettings. Is it similar to yours? Did you try custom js code?
  6. @rafaoski Are you talking about the field settings? Could you please explain more detailed what happened that I can reproduce the issue. Thanks.
  7. Have you recently made changes to namespaces in your templates?
  8. I played around a bit with custom JS based Input. Here are the settings for 3 individual JS based input options: ColorPicker by Stefan Petr (http://www.eyecon.ro/colorpicker/) initial JS $('#{id}').ColorPicker({ color: '{value}', onChange: function (hsb, hex, rgb) { $('#{id}').attr('value', '#' + hex); } }); include JS colorpicker/js/colorpicker.js include CSS colorpicker/css/colorpicker.css JSColor by Jan Odvarko (http://jscolor.com/) initial JS var input = document.getElementById('{id}'); var picker = new jscolor(input); include JS jscolor-2.0.4/jscolor.js Color Picker (http://dematte.at) initial JS $('#{id}').colorPicker(); include JS dematte/jQueryColorPicker.min.js Pull js file from here: https://github.com/PitPik/colorPicker/blob/master/jQuery_implementation/jQueryColorPicker.min.js
  9. If I understand you right you want to provide a simple file select if a user click the link icon in the CKEditor. I would do this with a hook in ProcessPageEditLink. Place the code in your ready.php wire()->addHookAfter('ProcessPageEditLink::execute', null, function ($e) { // exit if page OR template doesn't match (modify for your needs) $pageID = wire('input')->get('id'); if ($pageID != 1234) return; $templateID = wire('pages')->get($pageID)->template->id; if ($templateID != 123) return; $form = $this->modules->get("InputfieldForm"); $form->attr('id', 'ProcessPageEditLinkForm'); $field = wire('modules')->get('InputfieldSelect'); $field->label = $this->_("Select File"); $field->attr('id+name', 'link_page_file'); $field->icon = 'file-pdf-o'; // TODO: create an options array (path => label) from files stored in a file field (multi values) via ProcessWire API // example $options = array('/path/to/file/example.pdf' => 'nicePDF'); $field->addOption(''); // allow unselect $field->addOptions($options); $form->add($field); // we need something like this to get the nice JS generated preview $markup = '<span id="link_page_url_input"></span>'; $form->set('appendMarkup', $markup); $e->return = $form->render() . "<p class='detail ui-priority-secondary'><code id='link_markup'></code></p>"; }); Inside CKEditor?
  10. Updated to Version 1.0.3 with one more Inputfield Option which allows to use any custom JavaScript.
  11. Hi @bernhard I added some screenshots.
  12. kixe

    10000 items

    Try lazyload: $pages->findMany(); https://processwire.com/api/ref/pages/find-many/
  13. 2 approaches: Textformatter Use a textformatter like https://modules.processwire.com/modules/process-hanna-code/ or create your own. Use this as a starting point: https://modules.processwire.com/modules/textformatter-page-images/ CKEditor Plugin Use a Filefield to upload files. Enable pwlink module in your CKEditor which allows you to link PW pages and files too. Add a css class to show the icon
  14. Did you check Family > Allowed Templates for Children in the parent page template?
  15. I am not sure if WireArray::sort() handles runtime vars. Try it out. foreach ($page->listing_images as $image) $image->aspectRatio = $image->width/$image->height; $page->listing_images->sort('aspectRatio');
  16. @adrian First of all: Welcome back! Great, Thanks! Check out my fork to see the changes I made. https://github.com/kixe/AdminRestrictBranch/tree/kixe Everything is working pretty good together with the small changes in ProcessPageList::executeNavJSON() Ryan is very busy and there are some other unsolved issues I am interested in. Furthermore there are many other places in the core where '1' is used instead of $config->rootPageID. I think it should be consistent but its not so easy to change this.
  17. What about putting a semicolon to the end of your echo line?
  18. FieldtypeColor is on github Fieldtype stores a 32bit integer value reflecting a RGBA value. Input 5 types of Inputfields provided Html5 Inputfield of type='color' (if supported by browser) Inputfield type='text' expecting a 24bit hexcode string (RGB). Input format: '#4496dd'. The background color of the input field shows selected color Inputfield of type='text' expecting 32bit hexcode strings (RGB + alpha channel) Input format: '#fa4496dd' Inputfield with Spectrum Color Picker (Options modifiable) Inputfield type='text' with custom JavaScript and/or CSS (since version 1.0.3) Output Define output format under 'Details' tab in field settings. Select from the following 9 options string 6-digit hex color. Example: '#4496dd' string 8-digit hex color (limited browser support). Example: '#fa4496dd' string CSS color value RGB. Example: 'rgb(68, 100, 221)' string CSS color value RGB. Example: 'rgba(68, 100, 221, 0.98)' string CSS color value RGB. Example: 'hsl(227, 69.2%, 56.7%)' string CSS color value RGB. Example: 'hsla(227, 69.2%, 56.7%, 0.98)' string 32bit raw hex value. Example: 'fa4496dd'(unformatted output value) int 32bit. Example: '4198799069' (storage value) array() array( [0] => 0-255, // opacity [1],['r'] => 0-255, [2],['g'] => 0-255, [3],['b'] => 0-255, ['rx'] => 00-ff, ['gx'] => 00-ff, ['bx'] => 00-ff, ['ox'] => 00-ff, // opacity ['o'] => 0-1 // opacity ) The Fieldtype includes Spectrum Color Picker by Brian Grinstead SCREENSHOTS Input type=text with changing background and font color (for better contrast) Input type=color (in Firefox) Javascript based input (Spectrum Color Picker) Settings Output Settings Input
  19. WireMail::header() function accepts string values only. // setting additional headers in WireMail $recipientsArray = array('valid1@example.com', 'valid2@example.com'); $recipientsString = implode(",", $recipientsArray); $wireMailObject->header('cc', $recipientsString); // OR $wireMailObject->header('bcc', $recipientsString);
  20. $pages->get("id=1216|1217|1218"); // returns a single page (first match) $pages->getById([1216,1217,1218]) // returns a PageArray and is similar to $pages->find("id=1216|1217|1218"); It should work if $sideMenuForms->render() function expects a PageArray as third argument and if the PageArray is not empty (check with $formnav->count)
  21. $current_user = $users->get(3085); $current_user->of(false); $current_user->galerias->add(2075); $current_user->save(); $existente
  22. @hellomoto This issue was fixed in late 2016 (module version 2.0.0 or 2.0.1). Please update to last version and try again. @PWaddict I pushed a fix and tested the module in 3.0.64. Please update to 2.0.8
  23. Try echo "<a href='{$page->child->url}'>first childpage</a>";
  24. You can get the original size via API: // a page has an image field named 'image' $page->image->first()->size(50,50); echo $page->image->first()->width; // returns (int) 50 echo $page->image->first()->original->width; // returns (int) 1000 (original size) // if there doesn't exist a variation of the image the $original property returns null Learn more: https://processwire.com/api/ref/pageimage/#api-original
×
×
  • Create New...