-
Posts
6,629 -
Joined
-
Last visited
-
Days Won
358
Everything posted by bernhard
-
pages.clone() doesn't clone repeater-fields
bernhard replied to Dennis Spohr's topic in API & Templates
imho it should work, maybe you can try it on a clean installation? -
can you please provide an example where this is annoying for you? other question: do you have an extension that brings you right to the php docs, for example when using "file_get_contents()"? or that shows e preview of that?
- 246 replies
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
@AndZyk do you have any settings for us? I think there are some techniques to tell the ide which class the variable is. @AndZyk I'd be interested in that as well. Maybe you already know how to do that? Thx!
- 246 replies
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
Yeah, same here. I used Felix Becker's but was never happy with it. Need to do some testing with the linked one but first tests where promising. In the screencast you see that it even picks the "pagebreak" property from rockreplacer which would not be possible with snippets created from the cheatsheet Also, you get a nice preview and docs and you can use "go to definition" or "peek definition" to go directly to the class file
- 246 replies
-
- 1
-
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
thx, I just tried that extension and it looks great! @kongondo I think his question was what is different from your version to normal intellisense? that's how it looks like with intelephense:
- 246 replies
-
- 2
-
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
If you want a GUI you can try RockGrid. It has a batch deletion feature.
-
Thx, the strange thing is that I've already tried a z-index of 999999999999999999999999999999999 on the panel and the language switcher still appears on top?!
-
Thx Adrian! @adrian and @tpr any ideas what could be done about that AOS lang-switcher appearing on top of the panel? z-index doesn't seem to help strangely.
-
Sure! ? Maybe - if it is easy - it would also make sense to have a fullscreen for the console code input. But that's only some ideas. Everything works great for me as it is. Just suggestions for improvements.
-
Hi @MischaK, welcome to the forum and the world of ProcessWire ? It's always interesting to read about experiences of others - depending on what your intention is on that topic, we also have the pub and dev talk forums. If you have questions related to processwire you'll always find a helping hand here in the forum. Enjoy ?
- 17 replies
-
- 1
-
-
- cms
- comparison
-
(and 1 more)
Tagged with:
-
Hey @adrian what do you think of adding a fullscreen button to the dump div right beside the collapse toggles? When having large dumps this could greatly improve readability and it would just need to apply a simple class with these css rules: element.style { position: fixed; left: 0; top: 0; z-index: 99999; width: 100%; height: 100%; background-color: #fff; overflow: scroll; } Then it could turn this: Into that: The collapse toggles still work. Of course we'd also need a "close fullscreen" button (or maybe ESC keyboard shortcut?)
-
Building a reusable function to generate responsive images
bernhard replied to MoritzLost's topic in Tutorials
hi @MoritzLost , thanks for the detailed tutorial! do you know this module? If yes, you might elaborate what is different on your approach ? -
You can do many kinds of sorting/counting/aggregating using RockFinder quite easily and efficiently, I just posted an example:
-
I created a demo-installation of RockGrid/RockFinder that I want to share soon that shows several examples of RockFinder/RockGrid Here's one example that @jmartsch requested support for - a grid listing the sum of all pages that reference this page: the residents can assign a house with a single pagefield: The php file for the grid (returning the final finder's sql, that's why I post it here) looks like this: <?php namespace ProcessWire; // the base table contains all houses // https://i.imgur.com/e5bC4sA.png $houses = new RockFinder('template=house', ['title']); // then we create another table containing all residents that have a living assigned // https://i.imgur.com/zYXEVIL.png $residents = new RockFinder('template=person|cat|dog,livesin.count>0', ['title', 'livesin']); // we join both tables and get a combined table // https://i.imgur.com/TE0vEPd.png $houses->join($residents, 'resident', ['livesin' => 'id']); // then we can modify the resulting SQL to our needs // https://i.imgur.com/UgzNqDD.png $sql = $houses->getSQL(); $sql = "SELECT id, title, count(resident_id) as numresidents FROM ($sql) as tmp GROUP BY resident_livesin"; // set the data // to check everything i created a test-grid where we can filter for the house title // https://i.imgur.com/9pdlYVz.png $this->setData($sql); The screenshots of the comments are here: -- -- -- -- -- The grid in the last example called "residents" is as simple as that: <?php namespace ProcessWire; $residents = new RockFinder('template=person|cat|dog,livesin.count>0', ['title']); $residents->addField('livesin', ['title']); $this->setData($residents); As you can see this somewhat complex example can be done in only 6 lines of codes (same example as above, just without comments): $houses = new RockFinder('template=house', ['title']); $residents = new RockFinder('template=person|cat|dog,livesin.count>0', ['title', 'livesin']); $houses->join($residents, 'resident', ['livesin' => 'id']); $sql = $houses->getSQL(); $sql = "SELECT id, title, count(resident_id) as numresidents FROM ($sql) as tmp GROUP BY resident_livesin"; $this->setData($sql);
-
there it is:
-
What do you think of this module versioning strategy?
bernhard replied to bernhard's topic in Module/Plugin Development
Good point. Need to have a look at his module. Didn't try it so far ? I wanted to make it supersimple but a PHP file would also be fine of courses. Thanks for the input! -
I just pushed an update to my RockGrid module and came up with a new strategy for the module's version numbering: https://gitlab.com/baumrock/FieldtypeRockGrid/blob/master/FieldtypeRockGrid.module.php#L13-24 I placed a changelog file in the repo: https://gitlab.com/baumrock/FieldtypeRockGrid/raw/master/changelog.md And then the module reads the first line as the version number: 'version' => fgets(fopen(__DIR__ . '/changelog.md', 'r')), That way I just update the changelog with some comments, have everything in place and the module automatically updates the version number. This is also handy to share one version number for all child modules (eg Fieldtype + Inputfield). I'm not sure about that one, though. Do you think it is a good or a bad idea to have one common version number for both the fieldtype + inputfield or do you think it would be better to have that separate. The concept of having a readme and reading the version number from there would not be affected.
-
Lots of updates for the weekend ? I merged all updates of the dev branch to master and bumped the version to 0.0.8 I added a changelog here: https://gitlab.com/baumrock/FieldtypeRockGrid/raw/master/changelog.md I added an example filter + floating filter that you can easily copy and customize Regarding the filter: To apply this filter to one of your columns you just need to do this (full example here: https://gitlab.com/baumrock/FieldtypeRockGrid#create-custom-filters): col = grid.getColDef('title'); col.filter = RockGrid.filters.example; col.floatingFilterComponent = RockGrid.filters.exampleFloating; Here is the example filter implementing a "smart search": https://gitlab.com/baumrock/FieldtypeRockGrid/blob/master/plugins/filters/example.js It looks like this: Code with removed comments to see that it only 100 lines of code for your very own filter without limits (custom GUI, custom filter logic etc):
-
Importing pages and empting trash incredibly slow...
bernhard replied to NorbertH's topic in General Support
Wouldn't it have been easier in that case to first get all the id's of the pages that are in the trash and then loop all available tables in the database and remove all rows that have a pages_id of the trashed pages? Maybe it's not that easy, though. Not sure... I'd do a backup first ? ? -
Hi mel, MySQL has a maximum number of 61 joined tables: https://dev.mysql.com/doc/refman/5.7/en/joins-limits.html Why are you adding those fields via ->addField and not just pass them in the fields array of the finder? Can you show your code and the resulting sql please? I'm not sure. Any chance you can send me a site profile to help you?
-
No, absolutely not ? You just have to make sure that it is loaded properly. I'd recommend you name your field and place everything in a separate related php file to keep everything clean and organized. You'll end up with much nicer processmodules like this one: The yourfield.php file can look like this: <?php namespace ProcessWire; $this->rg->assets->add($this->config->paths->siteModules . 'FieldtypeRockGrid/lib/moment.min.js'); $this->rg->assets->add($this->config->paths->siteModules . 'FieldtypeRockGrid/lib/currency.min.js'); // your finder here $finder = ... // set data $this->setData($finder); // send variables to JS // for example you can send an array of key/value pairs of a select options field // in the grid you can then replace the options ID that is returned by the finder with the corresponding label // like that (pseudocode): cellRenderer = function(params) { return grid.js.youroptions[key] } $this->js([ 'youroptions' => $youroptions, ]);
-
thx, I updated the readme and it will be committed in the next version. It now looks like this: You need to include `moment.js` to your assets. In your field's php file do this: ```php // eg site/assets/RockGrid/fields/yourfield.php $this->rg->assets->add($this->config->paths->siteModules . 'FieldtypeRockGrid/lib/moment.min.js'); ``` Assets is a property of FieldtypeRockGrid, you are inside the inputfield so there is no assets property. Does that help?
-
Importing pages and empting trash incredibly slow...
bernhard replied to NorbertH's topic in General Support
Tracy debugger can help a lot monitoring such things. You have the log function where you can dump something to files. You can then follow in real-time what's happening. Eg l("removing page $page->id from trash"); and monitor the logfile, eg tail -f site/assets/logs/tracy/info.log Not sure if that path is correct ? You might also use flush the pages cache: https://processwire.com/api/ref/pages/uncache-all/ or something like https://processwire.com/talk/topic/7572-processwire-recipes/?do=findComment&comment=88505 -
OK I couldn't find the post any more..