-
Posts
6,671 -
Joined
-
Last visited
-
Days Won
366
Everything posted by bernhard
-
[SOLVED] Extremely slow to open / save one template type in admin
bernhard replied to prestoav's topic in General Support
yes, tracy is awesome and would recommend you having a look though sometimes it slows things down a little. i also experienced that the debug mode can slow down things. in your case i would do the following: backup install tracy and see if you find any strange things (errors, many redirects etc) create a new template, check performance if performance is ok, add fields of your slow template one by one and check after adding each field. if it slows down at some point you could investigate further -
[SOLVED] Extremely slow to open / save one template type in admin
bernhard replied to prestoav's topic in General Support
i would have been surprised if that had made a difference thats why i asked this: -
Hi @nickngqs and welcome to the forum It totally depends on your client and his needs and you are the only one that can know that if you want some stats: https://blog.sucuri.net/2017/01/hacked-website-report-2016q3.html but that may help you or may not...
-
[SOLVED] Extremely slow to open / save one template type in admin
bernhard replied to prestoav's topic in General Support
no need for a tutorial - it's too simple just add a fieldsettab to your page, save it, then you'll get a warning and a second field called yourfield_END. place your fields in between those fields and they will be presented in a tab. there is a little issue with ajax tabs though: https://github.com/processwire/processwire-issues/issues/332 are you using tracy debugger? are you using any hooks? any modules? -
hi rushy, maybe i'm misunderstanding you but it sounds like you are trying to display the description of the FIELD and not the description of the IMAGE? you do not have a template override option for image descriptions... this is where you put the description of your images:
-
How to upload files without changing original filenames
bernhard replied to homma's topic in General Support
you could just take the code example from abdus, activate url segments for your site and do something like this: // list your files to download foreach($page->files as $i=>$file) { echo '<a href="' . $page->url . $i . '" target="_blank">Download File ' . ($i+1) . '</a>'; } and in your template file: if($num = $input->urlSegment1) { $file = $page->files->eq($num); // continue with abdus script } maybe not without bugs but should show one possible solution -
How to upload files without changing original filenames
bernhard replied to homma's topic in General Support
may i ask WHY? if we know the reason we may can suggest some other way of achieving almost the same need -
Help Setting Up Input for Tabular Data Output?
bernhard replied to John W.'s topic in General Support
btw: the (no so cheap) pro version of handsontable allows nested headers: https://docs.handsontable.com/pro/1.4.0/demo-nested-headers.html but i don't know if that would work with my module... -
Help Setting Up Input for Tabular Data Output?
bernhard replied to John W.'s topic in General Support
hi, could be a perfect fit for my Handsontable module: if the headers are always the same you could just set them up in your field settings. the problems with my module are that the field will not be queryable (does that word exist?) and that it is currently not easily possible to add columns to the field lateron since the field settings will change but the data stored in the field will not. if that's no problem for you it could be worth a try @szabesz the datatables module is more for presentation inside the admin, not for input -
ok, no problem at all. thanks for taking your time on this
-
hi adrian, no, thats not the problem at all. i don't think it is related to tracy. i think the problem is my nginx proxy that has some problems with some of the tracy output. don't know exactly and to be honest i'm not really interested in investigating at the moment i know about the toggle and on/off buttons of the tracy bar and they are really great and helpful. though in my special scenario it would be great to be able to turn off tracy from the API. like a $pages->of(false). that way i could disable tracy for the pdf generation process (i will not see the output anyhow) and tracy would stay enabled for all my other requests in the admin or on the frontend side. the problem occurs only when i have some warnings in the tracy bar. maybe also on errors, i don't know exactly - it's very hard to debug... for me the easiest solution would be to add something like $tracy->off() at the top of my pdf script. but i'm fine with switching it on/off manually. i was just curious if an option like this already exists. thank you
-
That could be a nice solution. I like the new repeater but sometimes it's much better to have real pages so maybe that could be a nice addition
-
hi adrian, is there a way to turn off tracy for some requests? i had some problems when generating pdfs with an nginx proxy showing 500 errors when i had warnings in the tracy bar. also this file's sourcecode looks not ideal to me: <?php namespace ProcessWire; echo 'here we are'; die(); output: here we are<script src="?_tracy_bar=content.eaefb361ce&XDEBUG_SESSION_STOP=1" data-id="eaefb361ce"></script> is there some kind of switch to turn tracy off? then i would not have to think of it during development and it would avoid mistakes... thanks
-
sorry, you could be right. i never used BCE so it sounded similar to your needs
-
Adding a second set of "Add" buttons on top to PageTable
bernhard replied to titanium's topic in Module/Plugin Development
szabesz, have you ever tried writing a custom process module? sometimes it's a lot easier to write your own custom admin-interface than modifying the regular page edit form it's easier than you might think! -
No reason for that i think. it's more an extended MarkupAdminDatatable + Fieldtype than a replacement of PageTable. PageTable is easier to setup and has it's place for other situations / audience.
-
@Sipho adrians BCE could also be an option for you. you can also include the lister as field in the page editor: @szabesz totally wrong it supports all fields - you just have to write your own return statement. that's what i was talking about: it's a little more effort to setup but it's a LOT more versatile. and it has column sorting and filtering onboard. also pagination of the results. for now it does only support ajax in one whole dataset. so tha pagination is done client side. that would have to be improved for large scale situations but it's totally doable. for example an image column would be as simple as this: Regarding the core-topic: I totally agree and i think it would be awesome if @ryan could take a look at my module and think about adding this to processwire. For me this has been an invaluable benefit in my last years projects... but it's still too incomplete for public use and would need some tweaking regarding support of mobile devices and - even more important - large scale.
-
Preview/Discussion: RockDataTables
bernhard replied to bernhard's topic in Module/Plugin Development
just to show that this module can render any kind of field (seems that this was not clear enough: https://processwire.com/talk/topic/16929-choose-custom-repeater-template/?do=findComment&comment=148803 ) a simple column showing images: // pic $col = new dtCol; $col->name = "pic"; $col->title = 'pic'; $col->className = 'minwidth'; $col->data = function($page) { if(!$page->pics->count()) return ''; return $page->pics->each(function($img) { return "<img src='{$img->maxSize(200,200)->url}' alt=''><br>"; }); }; $t->cols->add($col); so you can do whatever you want and whatever the API + PHP can do... the module even supports a plugin-system where we can easily build cell-renderers that handle common tasks and make rendering even easier. this for example is the js file of the column filter that shows a filter input on top of each column: /** * this plugin creates filter inputs for every column * * #### usage #### * just set your table's settings: { colfilter: true } * * #### issues #### * the column filter breaks the table's column alignment on window resize * * #### roadmap #### * make it possible to have different kind of inputs like range sliders and dropdowns * */ /** * make sure that the tables searching setting is set to true */ $(document).on('beforeInit.rdt', '.RockDatatable', function(e, dt) { if(!dt.settings.colfilter) return; $table = $(dt.el); if(dt.settings.searching == false) console.log('overwriting setting "searching" to true for table ' + $table.attr('id')); dt.settings.searching = true; }); /** * add colfilter row to table header */ $(document).on('afterInit.rdt', '.RockDatatable', function(e, dt) { if(!dt.settings.colfilter) return; var $table = $(e.target); // table dom element var table = $table.DataTable(); var $thead = table.table().header(); // prepare the new header row var $tr = $("<tr role='row' class='colfilter' />"); $.each(dt.columnNames, function() { $tr.append($('<th><input type="text" class="colfilter"></th>')); }); // add it to the table header $tr.prependTo($thead); }); /** * handle filterinputs */ colfiltertimer = 0; $(document).on('keypress keyup change', 'input.colfilter', function(e) { var $input = $(this); var $tr = $input.closest('tr'); var $th = $input.closest('th'); // datatables splits the table in 2 divs when scrollX is used! thats why we need to find the table via the wrapper var table = $input.closest('.dataTables_wrapper').find('table.RockDatatable').DataTable(); var regex = false; // disable enter form submit var keyCode = e.keyCode || e.which; if (keyCode === 13) { e.preventDefault(); return false; } // delay search while typing clearTimeout(colfiltertimer); colfiltertimer = setTimeout(function() { table.columns($th.index()+':visIdx').search($input.val(), regex, false).draw(); }, 500); }); this may look complex in the beginning but once we have such a plugin we only have to set one option of the table and the filter inputs appear -
what features are you talking about exactly? I'm using my DataTables Module/Field for all my Projects recently. It's a little bit more effort in the setup but a lot more powerful regarding display features. Though i have to admit that the mobile support could be improved... I'm using links to pw-modals a lot for editing. So it's not real ajax-inline editing but i like how simple and versatile everything is. also a nice example: but there is still a lot to do, so i'm curious what you guys think is missing for pagetables crowdfunding would be nice
-
maybe you could either use a lister with ajax editing: https://processwire.com/blog/posts/inline-ajax-page-editing-comes-to-listerpro-processwire-2.6.6/ or if you only have simple text inputs and don't need selector support you could use my handsontable module:
-
just a wild guess and maybe complete nonsense but did you try your script without the logging? the log saves to files, so maybe that's getting slow (and huge logfiles)? but copying half a million pages data from parents to children sounds not too good anyhow and i guess (second guess in 3 sentences ^^ ) there is a better solution...
-
don't know if i understand you correctly... maybe the "pagetable" is something for you? you can just install it from modules > core > profields: page table it has some extension modules:
-
hi sirhc, you could create a page reference field on your photo-template and when a user clicks on like you can add this user to the pagefield. if you have lots of users (likes) that could cause some problems on the page edit screen i guess, but if you set the field to hidden it should work. like count is as easy as counting referenced pages (users). show all liked photos would be an easy selector like "template=photo,likes=youruserid" most likes this week... hmmm... that's not possible with the setup above. then maybe it's better to create 2 new templates: 1) likes (just the parent for all likes) 2) like (pagefield referencing the photo, user that liked) then you can create a new "like" page whenever a user likes a photo and then you can also count all likes of that week: $pages->count("template=like,photo=yourphotoid,created>xxx,created<yyy"); and counting all likes for one photo would be even easier: $pages->count("template=like,photo=yourphotoid");
-
does that help?
-
Module: AIOM+ (All In One Minify) for CSS, LESS, JS and HTML
bernhard replied to David Karich's topic in Modules/Plugins
i don't know what the code does exactly, so if you also don't understand it in detail you have 3 options wait and hope that somebody else helps you you invest some time, learn something about REGEX and try to find a way that prevents the module of minifying your comments buy procache for 49$ and be happy (for 1 site) and benefit of a lot more options and improvements that it offers (or pay 169$ for unlimited sites)