• Content count

  • Joined

  • Last visited

  • Days Won


bernhard last won the day on September 16

bernhard had the most liked content!

Community Reputation

1,320 Excellent

About bernhard

  • Rank
    Hero Member

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Vienna, Austria
  • Interests

Recent Profile Visitors

10,099 profile views
  1. wow, @abdus thank you for that hint! just took a look at their service and played around with their demo ( and this looks amazing! would love to see a module integrating with their service!
  2. this query will not be slow, so it would be nice if you showed us your current code
  3. you have 3 possibilities on any page of the admin. does not seem too hard for me?!
  4. Have you ever tried to work with reno for some time? my first steps for every project: - reno - tracy - AOS but it took me some time to get used to reno but it's much nicer to work with imho. you have the quicklinks on the left side always available AND you have more space on the right. i guess i didn't like it in the beginning, because it reminded me of the look and feel of wordpress hope we see some action on the new admin theme soon too. and i agree with you guys that the website looks way more old fashioned than processwire is. It's like visiting a website that has the latest news entry saying "merry christmas 2007 to all our visitors!" i always "apologize" for the look&feel when i present processwire to other devs and i tell them that they should take a look under the surface.
  5. thanks @adrianromega thats the breaking change i was talking about here:
  6. nothing fancy here. you see it's not polished and some hardcoded values... the javascript to handle the clicks: $(document).on('click', '.ckesnippet', function() { // find correct ckeditor instance $field = $(this).closest('li.Inputfield'); var id = $field.attr('id'); var ckename = id.replace('wrap_',''); var cke = CKEDITOR.instances[ckename]; var data = cke.getData(); cke.setData(data + $(this).data('snippet')); return false; }); and the hook to modify the field: $this->addHookBefore('InputfieldTextarea::render', $this, function($event) { $field = $event->object; if($field->name == 'rockinvoice_suffix') { $del = ''; foreach($this->wire->pages->get(38967)->texttemplates as $item) { $field->entityEncodeText = false; $field->description .= $del . '<a href="#" class="ckesnippet" data-snippet="' . str_replace(PHP_EOL, '', $item->body) . '">' . $item->title . '</a>'; $del = ' | '; } } elseif($field->name == 'rockinvoice_prefix') { $del = ''; foreach($this->wire->pages->get(38967)->texttemplates_greeting as $item) { $field->entityEncodeText = false; $field->description .= $del . '<a href="#" class="ckesnippet" data-snippet="' . str_replace(PHP_EOL, '', $item->body) . '">' . $item->title . '</a>'; $del = ' | '; } } $this->wire->modules->get('RockTools')->loadAsset('ckesnippets.js', 'HrDiamonds'); }); and a repeater to setup the snippets:
  7. it's one of many custom "hacks" all the items can be set by the client on a custom settings page. it's a regular repeater. then there is a hook that renders that items as field description and some javascript that adds the html to the ckeditor. thanks. no problem at all. but there's not really a lot of data... the table showing all the revenues for different years is a custom DB-view because there's no built in possibility for such listings in pw. the pw alternative would be many many foreach loops and thats a no-go.
  8. hi adrian, data is stored just as normal pw pages. nothing fancy here. this makes it very easy to use! the current setup is that you need 3 files to define your field: // yourfield_data.php <?php // return all relations that belong to this project return $pages->find( "template=feedback". // find all relations ",has_parent=$page" // project must be the current project ); // yourfield_columns.php <?php namespace ProcessWire; // sample column showing the ID of the page $col = new dtCol(); $col->name = "id"; $col->title = 'Columns ID'; $col->data = function($page) { return $page->id; }; $this->cols->add($col); // yourfield_js.js (optional, but in most cases necessary to do advanced stuff) var settings = { select: true, pageLength: 100, }; I'm also very excited to take this further. I cannot release it at the current stage though because major changes are not only likely to come but almost planned i have to work more on performance. I'm thinking about some kind of caching technique and maybe also providing AJAX pagination. some things like column statistics would only work on the client side when all the data is loaded, though. but i know that datatables can handle several thousands of rows quite efficiently so i think i'll find a way to work with those amounts of data.
  9. i totally agree. i don't think it's necessary, but i think it would be nice to have a warning on the login site. a simple noscript tag could make things clear and save us from support-requests like "hey, my admin tree does not show up" where one's first thought could be a permission problem or the like...
  10. pw needs javascript all over in the admin so there's no way to make it work without. i agree it would be nice to add a warning. the login screen would be a nice place. you could do a PR and add some warning here that would be hidden via javascript and therefore only visible to clients without javascript.
  11. another example how versatile and extendable this module is: you can write your own plugins to show custom column statistics. here i'm showing max, average and minimum values of some collected feedbacks. X means no answer and is excluded from the stats: plugincode is quite simple once you know the basics of datatables api: $(document).on('update.rdt', 'div.colstats, div.colstatsselected', function(e, table, col) { var $div = $(; var $table = $(table); var table = $table.DataTable(); // get table settings var id = $table.attr('id').replace('RockDatatable_',''); var dt = ProcessWire.config.RockDatatables[id]; var colname = dt.columnNames[col.index()]; var selector = {search: 'applied'}; if($div.hasClass('colstatsselected')) selector.selected = true; // get data var data = table .rows(selector) .data() .filter(function(row) { // return true if it is a number // don't count empty cells or "noanswer" cells that have an X return row[colname]*1; }) .pluck(colname); // get sum + rows var sum = data.sum(); var rows = data.length; // early exit? if(!sum || !rows) { $div.html(''); return; } // add stats for each column var avg = sum / rows; $div.html( ' ↑ ' + Math.max.apply(null, data) + ' ø ' + avg.toFixed(2) + ' ↓ ' + Math.min.apply(null, data) ); });
  12. yeah, he is the developer of the images fieldtype... so the question is why he thinks it would be bad to handle allowed extensions and maxfile settings in a template context?!
  13. very interesting article and very well put together. i'm wondering why for example the maxfiles setting for images fields is not activated by default for template context. any ideas on this?
  14. very nice site! maybe profiler pro can help you finding bottlenecks? i have not worked with it but would be interested to see an example
  15. thank you all for your kind words! would be nice to see some screenshots or to hear what you did