-
Posts
6,308 -
Joined
-
Last visited
-
Days Won
318
Everything posted by bernhard
-
[Solved] RockPageBuilder Drag-and-Drop Compatibility with FireFox
bernhard replied to netcarver's topic in RockPageBuilder
Hi @netcarver thx I've just tried and I can reproduce this. It's a little weird because the sortablejs demos work fine! I'll have to look into this. Thx for the report ? -
Create a script that does what you want (publish one page) Trigger that script once a day For (1) read https://processwire.com/docs/front-end/include/ and for (2) you can either use https://processwire.com/docs/more/lazy-cron/ or - the better solution - a regular unix cron if possible.
-
[SOLVED] RockPageBuilder .block class collides with tailwind
bernhard replied to dotnetic's topic in RockPageBuilder
Tailwind? I agree ? -
Prevent module from installing if requirements not met
bernhard replied to MarkE's topic in Module/Plugin Development
To be honest I don't have time to check that on my end. But it sounds like something that could be easily checked with a demo-module on a fresh install of PW and if it's like you said here then I'd ping Ryan about the problem in the issues repository ? I guess there is either a reason or a bug ? -
[SOLVED] RockPageBuilder .block class collides with tailwind
bernhard replied to dotnetic's topic in RockPageBuilder
Thx. Please check out v5.0.4 and mark this thread as solved ? -
I've recently started using https://marketplace.visualstudio.com/items?itemName=SergeLamikhov.aligntokens to align my code for better readability (especially when having lots of field constants or lots of hooks): Before After What I find nice is that it does not do that stuff automatically and it lets you decide which token to use for alignment. On top we align by "=" and in _init() we align by $this ?
- 242 replies
-
- 1
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
This is so great!! Thx @ryan and @Jonathan Lahijani and @thetuningspoon for suggesting this. I've just implemented first class support for this in RockMigrations and it comes in really handy for the development of RockCommerce. There I have a repeater where clients can add Accessories for every Product. Instead of being RepeaterPages they are now \RockCommerce\Accessory objects which is a lot nicer and makes the code a lot cleaner and I can get rid of many hooks and now my IDE actually understands my code ? For everybody using RockMigrations all you have to do to make that work is to place your file in /site/modules/YourModule/repeaterPageClasses/Accessory.php and add the field constant to that class so that RockMigrations knows which field to apply the pageclass to: <?php namespace RockCommerce; use ProcessWire\RepeaterPage; class Accessory extends RepeaterPage { const field = "rc_product_accessories"; } While working on this I have also improved autoloading of custom page classes and autoloading of regular PHP classes or traits: MyModule/classLoader will auto-load regular PHP classes or traits MyModule/pageClasses will auto-load PW custom pageclasses MyModule/repeaterPageClasses will auto-load PW custom repeater classes (and trigger init() and ready() for them) Extensive docs are already on the dev branch (https://github.com/baumrock/RockMigrations/tree/dev/docs/classloader) and will be merged to main begin of next month ? This is also the case when using $pages->newPage(...) - not sure if that's intentional @ryan ?
-
<?php $f->entityEncodeText = false; $f->notes = str_replace( "[icon]", "<i class='fa fa-check'></i>", $this->_("Some text [icon] Some more Text.") );
- 1 reply
-
- 1
-
Yeah I'm only talking about the selection part. The field would then obviously be added to the list as normal, not listed as tags inside the inputfield.
-
Wouldn't it be better to use InputfieldTextTags instead of the boring select field? That has search capabilities already and when having a lot of fields typing is for sure faster than browsing with the mouse ? Fields could still be prefixed with the tag, for example something like [RockCommerce] Price
-
Yesterday I had a chat with @gebeer and he showed me Cursor - The AI First Code Editor. It's based on VSCode, so if you are working with VSCode it will be a very similar experience. It can help you writing docs: It can help you refactoring code: And it can help you writing newsletters (testing that it understands the contest of the file for the prompt): I'm sure it can do much more great stuff. @gebeer mentioned a @docs feature - maybe you want to explain that? ? You can either access the AI with your own OpenAI API key or you can use their free tier or buy a subscription starting from 20$ per month. I'm testing it but so far it looks like a good companion. What it did not do for me is to translate all JSON files in the /de folder to spanish translations in the /es folder. It told me it can't do that directly but gave me a python snippet how I can achieve this. I'm in contact with @FireWire about that ? Have a good weekend! Ah, and if you are not subscribed to Rock Monthly here is the link: https://baumrock.com/rock-monthly/ ?
-
I just had a look at an old site that I built for an agency and cannot share unfortunately. But I'd be interested in how that design pattern could have been built in a better way. I know it was more complicated than I first thought, because there are some challenges in this simple looking design: The grid was done using UIkit grid, the dropdown bubble was done using an UIkit accordion. So far so simple. Problem 1: Where to place the bubble in the markup? In the sown example (on desktop) it has to be after the third image. On mobile it's after each image. Problem 2: How to position the pointer properly in the center of the clicked image. Of course the team-page had more than just 3 images. So after the bubble the next row of images was shown. Is there a simple CSS-only solution? I can remember I hacked something together with some JS. It worked, but it was not really elegant. I think I saw a video on youtube the other day, but I can't remember ? Any tipps would be appreciated ?
-
FYI: You can also "follow" a topic on the top right and then choose when to get notifications about new posts, eg asap or once a day. ? You can even subscribe to whole categories.
-
Really nice module! Just tried it and it works great and really improves the UI/UX. Thx for sharing ?
-
RockSettings - Manage common site settings like a boss.
bernhard replied to bernhard's topic in Modules/Plugins
Thx @zoeck I agree. I talked to Ryan before developing this module, but it seems he didn't see the need for such a feature. I was asking for a dedicated settings page without any fields that we could have as a standard for other modules to build on. Similar to the admin page with id=2 I thought of /settings having id=100 or something. But I'm happy now with this solution and it's already installed on several sites. ? -
I'm proud to share another module with you. Compared to other settings-modules this module has the benefit that it creates a real page, which means: You can access it via $settings or settings() from everywhere You can upload assets like a logo or global images or files You can add/hide/change all the fields of the settings page as you like It (optionally) adds a settings-icon to the main navbar of the backend It has a redirects feature to create short-links like yourdomain.com/example Download + Docs: https://www.baumrock.com/processwire/module/rocksettings/ If you have feedback or any suggestions for improvements let me know!
-
Compared to previous similar modules this is using SVG icons, so there is no overhead in loading an icon-font or such. Just upload your svg iconset to /site/templates/RockIcons and check the checkbox in the module's settings to load those icons. Rendering a selected icon is as simple as echoing the field, because if you request the field value as string it will return the SVG markup. Download: https://www.baumrock.com/en/processwire/modules/rockicons/
-
Great news ? I've just pushed v3.35 which adds auto-loading of pageclasses to RockMigrations! Now if you are developing a module that ships with custom pageclasses all you have to do is to add them in the /pageClasses folder of your module and add the proper namespace! ??? See the docs here: https://www.baumrock.com/en/processwire/modules/rockmigrations/docs/custom-pageclass/ What about PRs? Having a watch priority as class constant for example sounds like a good idea to have ?
-
Force guest users to login with no backend access at all [solved]
bernhard replied to cwsoft's topic in General Support
Hiding from guests is quite simple, see how I do it in RockMigrations: https://github.com/baumrock/RockMigrations/blob/141143a9108e1cc0eed52ed3bd53ed06a5ff3cb0/RockMigrations.module.php#L2243-L2275 Then you could add something like this into /site/templates/admin.php: <?php $user = wire()->user; if($user->isLoggedin() and !$user->isSuperuser()) { $session->redirect("/"); } I guess you'd improve that to check for login/logout pages, but you get the idea ? -
No. What I'm always doing is this in Site.module.php: $rm->createTemplate('foo'); This will create the template if it does not exist and it will automatically trigger ->migrate() on an in-memory page that has that template. On subsequent requests the template does already exist and if it's a MagicPage then it should automatically be watched for changes. PS: Did you read the phpdoc on migratePageClasses() ? ? DEPRECATED AS OF 24.7.2023 * Please use $rm->pageClassLoader() instead! * * Migrate all pageclasses in given path * Note that every pageclass needs to have the template name defined in * the "tpl" constant, eg YourPageClass::tpl = 'your-template-name' I have to add better docs on that one day...
-
Using version 5.1.0 we can use the conventionalcommits preset without any other dependencies ? This is what I'll use from now on in all my modules: name: Releases on: push: branches: - main jobs: changelog: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: conventional Changelog Action id: changelog uses: TriPSs/conventional-changelog-action@v5.1.0 with: preset: "conventionalcommits" github-token: ${{ secrets.github_token }} - name: create release uses: actions/create-release@v1 if: ${{ steps.changelog.outputs.skipped == 'false' }} env: GITHUB_TOKEN: ${{ secrets.github_token }} with: tag_name: ${{ steps.changelog.outputs.tag }} release_name: ${{ steps.changelog.outputs.tag }} body: ${{ steps.changelog.outputs.clean_changelog }}
-
If you are working with Git I highly recommend installing the "git graph" extension: This extension truly helped me understand everything around git way better (What is this origin? What is this HEAD? What is a rebase actually doing? etc...). It also has great right-click-menus with helpful actions: Unfortunately the author of the extension seems to be not available any more and the license seems to be quite restrictive so that forking is not allowed, but it's an interesting read: https://github.com/mhutchie/vscode-git-graph/issues/715 I didn't find a good alternative. If anyone knows one please let us know ? https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph
- 242 replies
-
- 1
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with: