-
Posts
6,629 -
Joined
-
Last visited
-
Days Won
358
Everything posted by bernhard
-
Just pushed v0.0.14 to github - caution, there is a BREAKING CHANGE (but a small one ? ) Initially I implemented a concept of column definition plugins to reuse column modifications ( for example you almost always want icons to show/edit/delete the row instead of showing the page id). Now that works with helper functions that are available through the RockGrid.colDefs object (and you can of course extend that with your own helper functions). It's easy to create those functions: document.addEventListener('RockGridReady', function(e) { RockGrid.colDefs.fixedWidth = function(col, width) { col.width = width || 100; col.suppressSizeToFit = true; return col; }; }); And using them is a lot easier than before: // before grid.addColDefPlugins({ id: 'rowactions', }); var col = grid.getColDef('id'); col.headerName = 'ID'; col.width = 70; col.suppressSizeToFit = true; col.suppressFilter = true; col.pinned = 'left'; // after var col = grid.getColDef('id'); col = RockGrid.colDefs.rowActions(col); col.pinned = 'left'; It will replace your ID with those icons: There are plugins available to add your custom actions to that column (or any other column) and you can even combine those plugins: col = grid.getColDef('title'); col = RockGrid.colDefs.fixedWidth(col, 100); col = RockGrid.colDefs.addIcons(col, [{ icon: 'file-pdf-o', cls: 'pw-panel', dataHref: function(params) { if(!params.data.pdfs) return; var pdfs = params.data.pdfs.split(','); if(!pdfs.length) return; return '/site/assets/files/' + params.data.id + '/' + pdfs[pdfs.length-1]; }, label: function(params) { return 'show invoice PDF ' + params.data.id; }, }]);
-
BTW: My smart filter does already support multiple filters (AND and OR) >50 <100 would list all items that are above 50 and below 100 ber bau would find Bernhard Baumrock, but not "Bernhard Muster" bernhard | beluga would find both "Bernhard Baumrock", "Bernhard Muster" AND "beluga" PS: So maybe you could just create a custom button wherever you want that sets my smart filter to one of those options. Even Regex is possible.
-
Something similar is now built into the core: https://processwire.com/blog/posts/processwire-3.0.118-core-updates/
-
Glad my answer helped you somehow. I don't have time to look into that in detail. You can have a look at how I built the smartfilter. It's a 100% custom filter and you can build your very own filter as well. I'd be happy to help you if you are building something like the https://www.ag-grid.com/javascript-grid-filter-set/ , because that's definitely something others (including me) would benefit of. You might also want to use my debounce function so that the filter does not fire on every single key press.
-
@Pete could you please also have a look at this issue? Thanks in advance!
-
Thanks for sharing! Awesome site ? I wonder why you didn't create a module for that. There was a discussion about that recently: But in your case I think it would make sense to pack it into a module. You could then: update it with one click across several websites extend the $page object via hooks instead of creating a new class share it with the community via github&co and the modules directory This: <?php namespace Processwire; use schwarzdesign\PasswordProtectedPage; $protectedPage = new PasswordProtectedPage($page); $protectedPage->handleRequest(); if (!$protectedPage->userCanAccess()) { [...] Would then become that: <?php namespace Processwire; $page->handleRequest(); if(!$page->userCanAccess()) { [...] And it would be really easy to achieve in your (autoload) module: $this->wire->addHook("Page::handleRequest", function($event) { // your code here }); I think you could even get rid of the "handleRequest" call and do that automatically in the background.
-
New post: Rebuilding processwire.com (part 2)
bernhard replied to ryan's topic in News & Announcements
Maybe the place for such resources would be the blog - just like we already do (and did: https://processwire.com/blog/posts/introducing-tracy-debugger/ ) -
First call is correct, second call is empty? Any ideas why that could be?
-
No idea, but maybe these informations are helpful: I'm using SessionDbHandler, error reporting E_ALL, laragon, win10; no warnings, no errors; I think it would be great to have the PW logo besides the Adminer logo so that one can go back to the PW admin if one uses the adminer process module from Setup > Adminer (which I prefer). Edit: <a href="/admin/" style="float: left;"> <img src="/wire/modules/AdminTheme/AdminThemeUikit/uikit/custom/images/pw-mark.png" alt="Back to ProcessWire" style=" height: 22px; margin: 5px; margin-right: 5px; margin-left: 10px; "> </a> And on smaller screens: Does anybody know how to inject that into <div id="menu"> ? Maybe some hints @adrian then I can do a PR - just don't know where to inject it properly ?
-
New post: Rebuilding processwire.com (part 2)
bernhard replied to ryan's topic in News & Announcements
Valid points! Download statistics and opening the system we already have for the API docs to 3rd party modules would be awesome! -
I just installed the version from github and I don't see any errors on chrome/win10... Let me know if I can help with debugging.
-
Thx @adrian didn't know this was possible! Of course that's totally sufficient ? I guess I tried it with wrong directory separators because I'm on Windows... This does work now, but it might be better (possible?) to stick with one version of the slash? site/modules\MyModule\src
-
Hey @adrian , I'm just developing a new module and using your todo-panel all the time. Now I had the plan to place some files in /site/assets and some in /site/templates, both having the folder name MyModule. The "problem" is that I want the files in /site/templates indexed by the todo-panel, but not the files in /site/assets (that's an external library). Is there any chance to make the filter more specific? Maybe a regex option? No problem at all if that is not easily possible, but if it is, I'd be thankful for such a feature ?
-
You can just copy over all the files (not a site profile) and make a DB dump and install everything 1:1 on your dev server. Or you can try to use https://modules.processwire.com/modules/duplicator/ No idea what is going on in your case ?
-
That's exactly why I built it - thanks for improving it further @adrian ? Just a quick tip you might find helpful. It makes the code more readable if you use constants instead of integer variables. You'll get them from intellisense in your IDE so it's also easier to look them up like this than heading over to the docs: @tiefenbacher_bluetomato Greetings from Vienna to Schladming(?) ? Looking forward to the winter ?
-
anybody could show an example of how to use $config->ajax ?
bernhard replied to adrianmak's topic in Getting Started
If "the rest" is not obvious you have two options: google ask a specific question here in the forum You are complaining that the examples suppose some kind of basic setup... But that's not a bad thing. That's just to have a common basis and to make sure all are talking about the same. If your setup is different, why don't you bring up a new installation and test things out the way several helpful and experienced people here in the forum where trying to explain? Maybe it has a reason why they do it how they do it?! Have you ever TRIED OUT one of the basic AJAX examples around the web? What are you talking about in your basic demo? Does it work? Does it not work? What author var are you talking about? Nobody here knows anything about your setup. You never told about it in detail. If you just started with one of the shipped site profiles everybody would know what you are talking about and what would be going on. Once that is working and you understand how and why you can move on forward to customized setups. -
Thx, I'm on Win10 + Chrome, just like @jmartsch ...and just had the error again using @ + arrow down + enter ?
-
Z index for sure not. Sticky header I think also no. I have to try tomorrow to narrow it down...
-
Thx for your feedback. It still bothers me every day...
-
New post: Rebuilding processwire.com (part 2)
bernhard replied to ryan's topic in News & Announcements
Yeah, actually I just wrote to my notes about why PW is great: Headless got innovative and trendy in 2018, PW works like this for several years now and is extremely mature. -
[offtopic] just wanted to mention that always when I log into a site with an older version of tracy I realize how much better the new not-so-colored theme is, thanks for that @adrian and @tpr ?
-
anybody could show an example of how to use $config->ajax ?
bernhard replied to adrianmak's topic in Getting Started
@modifiedcontent here you go with a very simple example using jQuery (but it's different for all javascript frameworks or vanilla javascript... I'm using the default profile for the example: home.php <?php namespace ProcessWire; if($config->ajax) { $content = "content loaded via ajax @ " . date('d.m.Y H:i:s'); } else { $content = $page->body . renderNav($page->children); } $sidebar = '<button id="loadrandom">load random page</button>'; _main.php: add this before your </head> <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> <script> $(document).ready(function() { // add an event listener for the click event on #loadrandom button $('#loadrandom').click(function() { // check your console if everything works console.log('button was clicked'); // use the load() method to replace the current content // of div#content by the content of div#content that is // returned from an ajax request to the current url ./ $('#content').load('./ #content'); }); }); </script> -
Would love to see such a tutorial! ?
- 10 replies
-
- 2
-
-
- beginners
- helper function
-
(and 1 more)
Tagged with:
-
Sounds great! Any chance for a short walkthrough of how you are doing it in the tutorials board? ? PS: Welcome @thepurpleblob, hope you enjoy ProcessWire ? PPS: We have also some projects that help you setup new installations of pw fast and easy (mine being alpha)