-
Posts
6,671 -
Joined
-
Last visited
-
Days Won
366
Everything posted by bernhard
-
you could do that quite easily using jquery datatables: https://datatables.net/extensions/scroller/examples/initialisation/large_js_source.html in the example they have 50.000 records without a problem. i'm working on a new datatables fieldtype right now. do you need it for the front or backend? maybe you can get some inspiration here, but be advised that i'm working on a new version (fieldtype similar to my handsontable fieldtype) and this module will change completely edit: of course server-side would be better and client-side depends on the clients machine. so if you have special requirements that could or could not be a good way to go...
-
for me 2 main reasons: i'm not so happy with the sftp plugin, the remote ftp plugin of atom is a lot nicer imho the github integration is great @fbg13 thanks, i'll check it out
-
you can use tracy and the console panel for that, not to get too independent from your favourite module builder
-
@Ivan Gretsky maybe you could just populate your pages via a little api script? I've never used adrian's module but maybe you can get the formatted values, create a new page and save it. then maybe a simple for does the trick...?
-
hi guys, just gave the forum a quick search about ATOM.io and landed on this thread. i tested atom the last days (coming from sublime) and i'm quite happy so far. it feels a little slower sometimes but there are great plugins (like used from sublime) and the new github integration is awesome!! you should definitely check that out (little screencast-like demo website, just click on "resolve conflicts" for example): https://github.atom.io/ this one gives also a quick overview (like many other):
-
i just saw adrian used php faker - i guess that's more powerful than my solution. but sometimes for quick testing the most simple solutions are the best
-
@Joynal and @Ivan Gretsky maybe my module is something for you: don't know why it didn't get any response (1 like...) - as it seems to be interest/need for those situations
-
thank you robin, this seems too complicated for my usecase. i'm working on a datatables fieldtype and i came up with this solution: private function getAjaxData() { $config = $this->wire->config; $input = $this->wire->input; // if the field is set AND the request was done via ajax we return the data of the table // if it was only the field variable it could have been requested as single field in a modal if($config->ajax AND $input->get->field === $this->name) { echo $this->getJSON(); die(); } } the data is requested via AJAX and the field is set. the further makes the field always load even if it is set to hidden+ajax - so i always get the json. don't think there's anything bad with this solution, but of course i'm happy to hear if im missing anything...
-
what about returning some json data from inside modules? the halt() method only applies to templatefiles. is there a way to halt any other output inside the admin (inside a module) other than this? echo json_encode($mydata); die(); or is it fine to do so?
-
Module Module: RuntimeMarkup Fieldtype & Inputfield
bernhard replied to kongondo's topic in Modules/Plugins
would you mind adding my suggested features to your module? sorry for not making a PR, but you can just replace your render method with this one: /** * Render the entire markup returned from FieldtypeRuntimeMarkup * */ public function ___render() { //so that $page and $pages are locally scoped to the eval $process = $this->wire('process'); if($process && $process->className() == 'ProcessPageEdit') $page = $process->getPage(); $pages = $this->wire('pages'); // render files that are related to this field $root = rtrim($this->wire->config->paths->root,'/'); $file = '/site/modules/FieldtypeRuntimeMarkup/fields/' . $this->name; if(is_file($root.$file.'.php')) { // we found a file in the modules /fields folder, so render it $str = wireRenderFile($root.$file); } else { // no early reaturn because we load assets later if(!$this->runtimeFields) $str = ''; else $str = eval($this->runtimeFields); } // load assets related to this field if(is_file($root.$file.'.js')) $this->wire->config->scripts->add($file.'.js'); if(is_file($root.$file.'.css')) $this->wire->config->styles->add($file.'.css'); //since we are dealing with custom PHP code but also want to make sure that only markup is returned //if eval() returns anything other than a string or an integer, we throw an error (e.g. if an object or array is returned) if (is_string($str) || is_int($str)) return $str; else return $this->error($this->_('Only strings and integers should be returned by your custom code! Check if your code is valid.')); } this will render all files inside the folder /site/modules/FieldtypeRuntimeMarkup/ - your_field_name.php | .css | .js -
thank you jacmaes, would be interesting to know why uikit does not mention that more prominent... maybe they just don't care too much about html validation?
-
hi, just checked a new sites html validation and came across lots of those errors: but it's exactly what the docs say: is it a problem of the validator? i thought custom attributes are fine for html5? has anybody more information about that for me please? thank you guys!
-
Didn't read the whole thread but just wanted to let you know that you don't need the hook here. The body has a class with the template name, so a single css selector would be enough Don't know when this feature was implemented though. EDIT: this is a feature of AOS, not core... body.ProcessPageEdit-template-YOURTEMPLATE ...
-
FieldtypeHandsontable: Excel-like Inputfield
bernhard replied to bernhard's topic in Modules/Plugins
Some more nice features copy&paste (eg from excel) that way the field could be used as an import-interface with live preview (much more userfriendly than CSV in my opinion) auto-add-rows (coulb be used as something like a repeater-replacement) hot.updateSettings({ colHeaders: ['Foods'], minCols: 1, maxCols: 1, rowHeaders: false, minRows: 1, minSpareRows: 1, }); auto-add-cols (like tagging) hot.updateSettings({ colHeaders: false, minCols: 1, minSpareCols: 1, rowHeaders: ['Foods'], minRows: 1, maxRows: 1, }); -
FieldtypeHandsontable: Excel-like Inputfield
bernhard replied to bernhard's topic in Modules/Plugins
hi @Juergen of course i can, there are a lot In general this field is useful whenever you need array- or matrix-like inputs. I use the field for my custom CRM to input the controlling values for my clients revenues. | jan | feb | mar ... ------------------------------------- goal 1 | 10.000 | 15.000 | 20.000 goal 2 | ... goal 3 It replaces lots of repeaters and not so userfriendly inputs. I didn't mention that you also have lots of possibilities of live-validating your data (you could for example make all cells with not properly formatted dates have a red background). You see the inputfields at the bottom of the screenshot? It was too complicated to build a table-like input for that values (month values). Pagetable is too bloated for that. Maybe the matrix inputfield would have been an option, but still i think the handsontable has a huge potential. So i ended up having a simple textfield input and telling my client to devide all values by commas... not the best way!! So whenever you have thought of a field telling your clients "one on each line" or "devided by comma..." this field could help you out. -
just for reference, i started to build a fieldtype module for handsontable:
- 33 replies
-
- 2
-
-
- crud
- handsontable
-
(and 3 more)
Tagged with:
-
Hi everyone, I'm proud to share my first fieldtype module and I think it's a quite handy one It helps you to create all kinds of table/matrix inputs very quickly and easily. You have loads of options for customizing your field via plain javascript. See the handsontable docs for that Please consider this module ALPHA until i got some more time to test it. Any help would be highly appreciated Numbers are for example always tricky. Different locale settings, different types, rounding errors and so on... Download: https://gitlab.com/baumrock/FieldtypeHandsontable Result: Installation/Configuration: Just install the Fieldtype, add a field to your template and set the handsontable options in the fields details. If you have InputfieldAceExtended installed you will also have code highlighting for your code: Get data: If you retrieve the data from the API with outputformatting ON you have some helper methods available: getData() + getRows() get all data of the field getRow($row) get one special row, eg getRow(1) or getRow("2017") getCols() get all data but by columns not by rows getCol($col) get one special column, eg getCol(1) or getCol("mycolumnheader") You can also access rowHeaders and colHeaders directly (see examples) Simple Example: Caution: the examples below are outdated! see this post:
- 54 replies
-
- 25
-
-
also check if your server is blacklisted: https://mxtoolbox.com/blacklists.aspx maybe you want to use a service for sending your mails: https://www.sparkpost.com/pricing/ (free for < 100.000 mails / month)
-
Hi, just stumbled over a little module that i built for my last project. it helped me to test performance of my rockdatatables module to generate 3000 random json datasets and i want to share it with you. maybe it saves some time for someone. https://gitlab.com/baumrock/RockDummyData/ easy example: $rdd = $modules->get('RockDummyData'); for($i=0; $i<15; $i++) { // this has to be inside the for-loop to always get a new dummy $dummy = $rdd->getDummy(); echo date("d.m.Y H:i:s", $dummy->timestamp) . "<br>"; } more advanced: $json = new stdClass(); $json->data = array(); $rdd = $modules->get('RockDummyData'); for($i=0; $i<3000; $i++) { // this has to be inside the for-loop to always get a new dummy $dummy = $rdd->getDummy(); $obj = new stdClass(); $obj->name = $dummy->forename . ' ' . $dummy->surname; $obj->position = $dummy->job; $obj->office = $dummy->city; $obj->color = $dummy->color; $obj->start_date = new stdClass(); $obj->start_date->display = date('d.m.Y',$dummy->timestamp); $obj->start_date->sort = $dummy->timestamp; $obj->salary = rand(0,10000); $json->data[] = $obj; } echo json_encode($json); you have to store your random datasets on your own into the /data folder. there are several services for creating all kinds of random data on the web - if you know one service that allows sharing those datasets let me know and i can include common needed data into the module
-
- 6
-
-
i recently found one very nice solution that would even be free for 1 "operator" and that has an API and is abased on PHP & MySQL so it should perfectly fit with processwire: https://www.livezilla.net/features/en/ so we would have a live-chat AND helpdesk in one place. and it should be quite easy do create a processwire module that creates a widget on our clients sites where they can report issues in the way WE want (with custom forms and the info we need). it would just have to create a ticket via the api and we could manage all the tickets in one place for all our customers. i didn't try it until now, but if anybody wants to give it a try i would be interested in the results
-
thank you macrura but the hash feature is not working in panels as i stated above anyhow - one click more than needed is ok for my client. thats nothing with priority so far. just wanted to throw in this idea and i'm happy if this finds it's way into this module. if not sooner, than later. totally fine for me i'm sure it would not be a big addition t edit: added a PR (quickfix) on github to support query strings like /?docs=my-single-docs-page taking the pagename of the docs page as parameter
-
thanks for mentioning me here mr-fan but i don't think my module would be a good solution here. its only intended to display data (like lister and listerpro do) but with a lot more customization options (like different renderers, eg rendering timestamps as dd.mm.yyyy but sorting based on the unix integer etc) i recently worked with chart.js (pulling data from my datatables module to have live filtering and sorting and see details that the chart hides because it shows only accumulated data). its very easy to use! you only have to provide a data array and set the options and thats it. some snippets may help to get an idea: var soll = { label: 'Controlling', data: getDataKum(goals[chartname]), borderColor: 'black', borderWidth: 1, borderDash: [10, 5, 2, 5], backgroundColor: 'rgba(0,0,0,0)', }; var ist = { label: 'IST', data: getDataKum(getIstData(chartname)), borderColor: 'green', borderWidth: 1, backgroundColor: 'rgba(0,0,0,0)', }; // chart data var data = { labels: ['jan', 'feb', '...'], datasets: [soll, ist], } // draw chart // this is inside a loop to draw 4 charts with the same settings // [...] $el = $('#'+chartname+'_chart'); charts[chartname] = initChart( $el, data ); /** * chart initialisation draw */ var initChart = function($el, data) { var myChart = new Chart($el, { type: 'line', data: data, options: { scales: { yAxes: [{ ticks: { beginAtZero: true } }] }, elements: { line: { tension: 0 } }, tooltips: { mode: 'index' }, }, }); return myChart; } getDataKum() just returns an array of values. you could also just provide a static array via $config->js, for example: // php $config->js('mysampledata', [1, 2, 3]); // js var myChart = new Chart($el, { type: 'line', data: ProcessWire.config.mysampledata, [...] }); happy charting
-
I read my post again.. Sorry for being too short and unclear. My situation is that I want to place some links to the docs in several places of my custom process modules (eg in field descriptions or the like). That means I don't have the page editor and thus no help tab. I can easily link to the docs process page but then all help sites are visible. That's not what I want. I want to link directly to ONE help topic. Bea's solution with the anchor tags does not work in modals because the modal does not open the link at the intended position. And it would be better to have only the intended topic visible in this case in my opinion. I hope you understand what I mean now?
-
hi @Macrura thank you for your efforts on this. it's similar to what i was up to do on my own. do you think it would be possible and not too much effort to have doc-pages available via urlsegments? the problem with the # tags is, that it does not work in panels. or at least i don't know how it would be nice to be able to link to the docs via links like this: <a href="/admin/setup/admin-help/myhelptopic?modal=panel" class="pw-panel">help for myhelptopic</a>
-
thank you @Robin S and @tpr - the last update fixed my repeater-image-problem