Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/27/2018 in all areas

  1. Pretty sure this was announced in a recent blog post with sessions in the database. Bank holiday in the UK so I will take a look in the morning.
    2 points
  2. Hi and welcome ... You can add your own field in a very simple way ... See also here https://processwire.com/api/variables/page/ You have to go to the template that the page uses and add a few lines of php code as below ... <?php echo page()->custom_field?> <?php echo $page->custom_field?> <?php echo page('custom_field')?> See this short video in which I used the regular UIKIT 3 profile which is in the Processwire DEV version You can display this field in the _main.php file in the same way, or if for example, you create an option page, you can use this way in which the field will be visible on all pages https://processwire.com/api/variables/pages/ ... <h1>Home Page Field ( / ) <?= pages('/')->custom_field ?></h1> <h1>Home Page Field ( / ) <?= pages()->get('/')->custom_field ?></h1> <h1>About Page Field ( /about/ ) <?= pages('/about/')->headline ?></h1> <h1>About Page Field ( /about/ ) <?= pages()->get('/about/')->headline ?></h1> This old tutorial is also good to starting learn Processwire : https://processwire.com/docs/tutorials/hello-worlds/
    2 points
  3. $u = $users->find("last_name=Smith"); foreach($u as $uu) { echo "{$uu->first_name} {$uu->last_name}<br>"; } // combine: (marital_status is a page-reference field in my test setup) $u = $users->find("marital_status=divorced, last_name=Smith"); foreach($u as $uu) { echo "{$uu->first_name} {$uu->last_name}, {$uu->marital_status->title} <br>"; }
    2 points
  4. Cool, thanks for the hiding tip! Hmm, now that I tested it, changing null to empty in JS does not seem to affect perf in any way. I actually did a quick JS flame graph comparison in Firefox and the relevant call took the same amount of milliseconds either way. So without any PDO hackery, the rockgrid.js PersonFilter.prototype.doesFilterPass in my previous example can be modified like this: this.filterText.toLowerCase().split(" ").forEach(function (filterWord) { var value = valueGetter(params); if (value === null) value = ''; if (value.toString().toLowerCase().indexOf(filterWord) < 0) { passed = false; } }); Btw. has anyone tried this: https://www.ag-grid.com/javascript-grid-row-height/#auto-row-height I tested it, but the result was just huge CPU chewing for a while (for a large data set), but row height did not adapt for cells with overflowing content. So simply col.autoHeight = true;
    1 point
  5. This happens when you have a grid that tries to show more rows, then adds scrollbars and therefore does not have enough space to show those rows and removes one. Then it tries the same thing again. You can set your grid to a fixed amount of rows. The number of rows in your case do not change. It's only the number of pages that changes (and that's correct of course, if you add/remove one row you'll end up with different page numbers). This can happen if you have page fields or repeaters with multiple items. The RockFinder might return those values as joined results with each referenced value in a separate row. Analyze your SQL or your RockFinder and the result itself to see where this comes from. You can comment out some fields of the RockFinder then you see which field causes the number of results to increase to more than you'd expect. You can either create a different SQL (see the RockFinder docs, or - sorry - look into the code). Another way to prevent such situations is to create a new hidden field that gets populated via saveReady hook and holds the information you need. Eg you create a field "linked_pages" that holds an array of linked pages, eg [{id:123,title:"demo page1"},{id:456,title:"demo page2"}] You can then use a cellRenderer to show this information as you want (eg with icons, as comma separated list, as number of linked pages etc.). It might sound complex but it totally makes sense when you build more advanced grids. Having said that, that's how it works right now. It's not perfect for sure. If you have any suggestions for improvement let me know. In that case just setup a valueGetter and make sure you return a proper value for all cells. This is how you make sure it is a number (for calculating sums/avg etc): document.addEventListener('RockGridItemBeforeInit', function(e) { if(e.target.id != 'RockGridItem_rockgrid') return; var grid = RockGrid.getGrid(e.target.id); var col = grid.getColDef('yourcolumn'); col.valueGetter = function(params) { if(typeof params.data == 'undefined') return; var val = params.data[colDef.field]; return val*1; // make sure the value is a number and not a string } }); Of course you can hide it: https://www.ag-grid.com/javascript-grid-column-definitions/ document.addEventListener('RockGridItemBeforeInit', function(e) { if(e.target.id != 'RockGridItem_rockgrid') return; var grid = RockGrid.getGrid(e.target.id); var col = grid.getColDef('id'); col.hide = true; var col = grid.getColDef('title'); col.headerName = 'MyDemoTitle'; });
    1 point
  6. Very good resource here: Refactoring with Visual Studio Code
    1 point
  7. GUID Generator Generate a globally unique identifier (GUID) for Inputfield Text. Usage For each instance of a text field the field settings will be extended. Navigate to Admin > Setup > Fields and edit the desired field. Click on the Input Tab and click on the "Generate GUID" area. It extends downwards and reveals a form to enable automatic GUID generation. After having enabled GUID generation for a text field, edit a page which has a template containing this field. You'll see the field filled with a GUID.
    1 point
  8. No guarantees, but from what I can tell about those changes, I don't think it should affect this module. If you find anything though please let me know and I'll attempt to fix it ASAP.
    1 point
  9. @ryan We also have these issues and those should really be changed of fixed if possible: Renewal We would like to renew three ProModules but have only renewal invoices for two of them, because one expired. Of course we messaged you, but as you are busy and don't always have time to respond, we don't have a new renewal invoice yet. If it is not possible to change this behavior, maybe more board administrators should be able to generate new renewal invoices. ? Download We are not able to download our previously bought ProModules, because our licenses have expired. We were able to help ourselves by downloading and saving them on our fileserver before, but as a customer I think it has to be possible to download your purchased ProModules. Maybe this could be solved by a dedicated download page in which you have to enter your license and after entering you get all downloads that were available in the time you have purchased the license. This could exclude newer downloads when your license has expired. Regards, Andreas
    1 point
  10. Actually, this was it ? I can't believe I wasted 15 hours on this due to a missing echo.
    1 point
  11. I have refactored a few things this morning. 1) On the module config settings page, if you have the Only display for EU visitors setting checked, the check for their status happens on every page load (session is ignored). This does not affect the frontend - users here will still only be checked once per session. 2) There is a new "Clear Local Storage" option to reset stored banner settings so that it's easier to test changes to the banner.
    1 point
  12. $home = $pages->get('/'); foreach($home->children as $child) { $content .= "<a href='{$child->url}'>{$child->title}</a><br>"; if($child->id !== 1035) { if($child->hasChildren) { foreach($child->children as $child2) { $content .= "- <a href='{$child2->url}'>{$child2->title}</a><br>"; } } } } page id 1035 would be archive parent
    1 point
  13. welcome to the forum @Hans0L0 I've setup a custom search shortcut "api" in my browser so i can just type "api and" and will get this result: You'll then get to the api docs quickly: https://processwire.com/api/ref/wirearray/and/
    1 point
  14. Well, I don't really care about a few seconds of start up time, if I have the benefits of a full fledged IDE for PHP and JS /TypeScript and CSS etc. afterwards. If I only need to quickly change a line of code, I'm using Kate or KWrite, which ship with KDE. Yes, NB is java based. Thank you.
    1 point
  15. What do you mean with "faster"? Not sure if having "tons of plugins" is necessarily an advantage. That said, NB has tons of plugins as well http://plugins.netbeans.org/ Thank you.
    1 point
  16. Btw. can you describe some of those various reasons? As a NB user, I would like to know if it makes sense for me to have a closer look at VSCode. Thank you.
    1 point
  17. Hello, the issue has been resolved. To anyone facing the same problem, do NOT set permission 'page-edit-created' role-wide; instead, add it as an additional edit permission in each template relevant to the role. Thank you
    1 point
  18. @bora: with the WireMailSmtp you can use one To and the rest in a CC field. But you also can have a look to the wiremail core class and how you can extend it, and build a small extension that does what you want. EDIT: btw, thats a friendly looking new avatar, you have!
    1 point
  19. Not with the core implementation of WireMail, which does explicitly send a extra mail per address.
    1 point
  20. The search.php file that comes with the default profile includes the following line: $matches = $pages->find("title|body|sidebar~=$q, limit=50"); That error suggests to me that you don't have the sidebar field in any of your templates, so you should remove "|sidebar" from the search.php file and I think you should be fine.
    1 point
×
×
  • Create New...