Jump to content

bernhard

Members
  • Posts

    6,629
  • Joined

  • Last visited

  • Days Won

    358

Everything posted by bernhard

  1. 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.
  2. 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...
  3. 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. https://github.com/processwire/processwire/blob/master/wire/modules/Process/ProcessLogin/ProcessLogin.module#L427-L451
  4. 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 = $(e.target); 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) ); });
  5. 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?!
  6. 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?
  7. very nice site! maybe profiler pro can help you finding bottlenecks? https://processwire.com/api/modules/profiler-pro https://processwire.com/api/modules/profiler-pro/#pages i have not worked with it but would be interested to see an example
  8. thank you all for your kind words! would be nice to see some screenshots or to hear what you did
  9. thanks @AndZyk i removed one of my large screencasts and have now another 10MB left. but still i find that restriction VERY annoying and is imho not good for active forum members that contribute a lot. @Pete is there maybe an option to set a special limit per time period?
  10. i like gitlab and i use it because of the free private repos (when i started using it bitbucket had such an old look...). in the beginning it was very slow but now i don't have any problems. i can recommend it (but i have to say that i'm quite new to git and only use it on my own for simple tasks)
  11. edit: i changed the download url! @Juergen can you try it again please?
  12. i guess that's an issue with the modules directory. can you please download the latest ZIP and install it manually? i don't know if the modules directory also works with gitlab... i just tried that by submitting my module and it seems it does NOT work. be advised that the update has a breaking change and you need to rewrite your javascript field settings after the update. the module is still alpha and more of those changes are still likely to come...
  13. hi jürgen, why did you do the update? is this post somehow related to your problem or sounds similar? can you try to make a fresh install and see if there are any errors? thanks
  14. hi everybody, since some weeks it seems that my attachment size is shrinking and shrinking. ATM i have only 1,52MB left and that's not enough if i want to share simple licecap screencasts. i sent @Pete a message but he hasn't read it yet. i also tagged him in another post and got no reply. is it only me having this problem? it's quite frustrating to invest time helping others here and not having the proper tools. i had to upload the gifs on my own server and paste them into the post. if anything changes that will lead to 404s - not the best for nobody. thanks.
  15. if you want or need another page (for analytics that could be nice to have) you can just create a new template eg, "contact-success", create a page with that template eg /contact-success and set your form action to that page ( action="/contact-success" )
  16. https://www.baumrock.com/portfolio/individuelles-crm-und-controlling-tool/ I'm happy to share my biggest and most interesting ProcessWire project so far with you It's a 100% custom office-management solution that helps my client to keep track of all their contacts, projects and finance/controlling stuff. Conception was done back in 2016 and the software is productive since begin of this year. My client is very happy with the result and so am I. Some technical insights: Everything is done inside the PW Admin. I'm using the Reno Theme with some custom colors. In the beginning I was not sure if I should stay with the pw admin or build my own admin-framework but now I'm VERY happy that I went with PW Almost all of my custom Process Pages use my RockDatatables module - there are still some limitations but without it, this project would not have been possible For the charts I used Google Charts and chartjs - both play well together with the datatables and make it possible to display filtered data instantly: also my handsontable module was created for this project to have a nice and quick option for matrix data inputs: Lister and ListerPro were no options as i needed much more flexibility regarding data presentation (like colorization, filtering and building sums of selected rows): invoices are highly customisable as well and easy to create. PDFs are created by php and mPDF by the way: all data is dummy data populated via my Module RockDummyData have a nice weekend everybody
  17. i would be happy to take over some backend part. i did some quick research on what's present at the moment at processwire.com and it looks like the only reasonable project lead could be ryan. we have the site, the modules directory, the forum, the dev-directory, the blog, store, showcase... i don't know how everything works behind the scenes. but as the roadmap also lists "new website" as a point i think it's at least on ryans wishlist. it would be really nice if ryan could manage to involve the community into this process. also i would really love to see more transparency what this "WE" in my quote of the roadmap actually is... as I stated on some other threads one of my main concerns with processwire at the moment is the quite high bus factor (https://en.wikipedia.org/wiki/Bus_factor) same here: available for that not before 2018, but willing to help wherever i can
  18. hi rushy and welcome to the forum! that does not sound good in the pw world you should avoid creating your own custom php files in the root of processwire. it's better to stay with the intended way of displaying pages, meaning you have a page in the backend and a related template. in your case you dont even need another template or another page. you can submit the form to the page itself. lets say you have a tempalte "contact" and in that template you display your form like this: <?php // /site/templates/contact.php ... <form ...> ... </form> just change your forms action to itself and add some additional php code to the top of your file: <?php // /site/templates/contact.php if($input->post->yoursubmit) { // do some checks and sanitization, eg spam-check // log this request echo 'Thanks for your message!'; } else { <form action="./"> <input type="submit" name="yoursubmit" ...> </form> } pseudocode
  19. maybe you have some other vhost rules active in your hosting settings? some hosting providers have settings to choose a www or non-www version of the site so if the vhost and your htaccess redirect to the opposite it would be an infinite loop.
  20. ah by the way: you don't need a pagetable if you stay with this solution. you can just store all items under one parent. that makes things a little easier usually
  21. the button somethink like this <a href="./?add=1">add item</a> the code something like this (in your template) <?php if($input->get->add) { $parent = $pages->get( your parent page ); if($parent->addable()) { // create a new page and save it } } // continue with your regular template code foreach($pages->find('yourselector') as $p) { // list your products // will already contain your new item } you could also make different add-buttons that hold some variables (like category or the like) --- delete: <a href="./?delete=123">delete item</a> and the code: <?php if($input->get->delete) { // find page that should be deleted $p = $pages->get($input->get->delete); if($p->id AND $p->trashable()) $pages->trash($p); } this would always need a page reload. with ajax the user experience would be much nicer (page not jumping around) hope that helps - but maybe someone has better suggestions
  22. as far as i understood this would only be possible for superusers and i would definitely not give your client superuser access... i think you have those options: profield table backend gui, but very clean and easy to manage, 150 items is a lot though repeater backend gui, little more "bloated", not sure how this would work for 150 items... pagetable you could use FE, but you need to implement add/delete/move functionality on your own. add/delete would be very simple, move would be a little more complicated. you could also do the sorting based on the position number (item number, seems to be your first field). that would maybe be not so user friendly. how do you plan to do the item numbering? automatically? why do you plan to have a field for that?
  23. you could use the core pagetable field, then you would also have frontend editing. adding and removing items would need some manual work but would not be very hard (send an ajax request, create a page with dummy-data, reload the frontend, double click to edit text)
×
×
  • Create New...