Jump to content

bernhard

Members
  • Posts

    6,670
  • Joined

  • Last visited

  • Days Won

    366

Everything posted by bernhard

  1. You can use the "fields-" key instead of "fields" and then it will even remove that field from your template without writing another migration. They are extremely cool πŸ™‚ And can be used alongside or alone. However anyone wants.
  2. I think the changed hook is not meant to revert any changes but only to listen to changes and trigger actions. But you can do this (not sure this is the best solution) - example using the title field in /site/ready.php: wire()->addHookAfter('Page::changed(title)', function (HookEvent $event) { $old = $event->arguments(1); $new = $event->arguments(2); $oldStart = substr($old, 0, 3); $newStart = substr($new, 0, 3); if ($oldStart === $newStart) return; // save old value to a temporary property that will be used // in the saveReady hook to revert to the old value $page = $event->object; $page->revertTitle = $old; }); wire()->addHookAfter('Pages::saveReady', function (HookEvent $event) { $page = $event->arguments(0); if ($page->revertTitle) $page->title = $page->revertTitle; });
  3. Hey @Pavel Radvan there is a mistake in my code. It should be != not == --> The purpose of this line is to only execute the rest of the callback for the template that you want. That means if the template is NOT your template, then it should exit. My code was not meant to be copy/paste ready. It's a boilerplate code to show you how it works. You have to make it work yourself or ask for help in the forum. But please not in this thread as we are getting out of scope here and we are not talking about RockForms any more. Please create another thread.
  4. Hey Pavel. I think it's the same with all form modules - that's not their primary goal. You'd have to update the page via API. But in your case it might be easier to modify the regular PW page edit form via hook: <?php $wire->addHookAfter('ProcessPageEdit::buildForm', function($event) { $form = $event->return; // the page being edited $page = $event->process->getPage(); if($page->template == 'your_template') return; // remove a field $form->remove('my_field_name'); // sometimes removing fields leads to problems, so you can do this: if($f = $form->get('my_field_name')) { $f->collapsed = InputfieldForm::statusHidden; } // make a field requried / not required if($f = $form->get('your_other_field')) { $f->required = true; // or false } }); That might be an easier approach?
  5. Hey Pavel. Sure. Why not? Any specific questions? Whether RockForms or FormBuilder is better depends on preferences I guess. There's also FrontendForms as another option. Not sure what you mean by "FormBuilder is quite big for this specific form".
  6. @ryan maybe it would be good to make existing installs use the old style and new installs use the new one by default?
  7. Same problem with the EditFieldLinks tweak https://github.com/baumrock/RockAdminTweaks/tree/main/tweaks/PageEdit/EditFieldLinks Do you think these issues can be fixed in the admin style or do we have to fix those issues in the affected modules?
  8. @theoretic just to confirm.. you have set AdminThemeUikit to use the "original" style?
  9. A quick backup strategy could be to setup https://processwire.com/modules/cronjob-database-backup/ to backup the database every hour (if it's not a huge site). Then at least the maximum risk should go down to the work of 1 hour. There have been several similar reports these days, but as @wbmnfktr mentioned I think they have been related to RepeaterMatrix only?! Not sure what the status of that is @adrian ? Luckily I have not encountered anything like that so far. It does not sound like that would be the case, but just to be sure... Do you have very, very much fields on that page? Then you might be hitting your server's max_input_vars limit.
  10. I haven't seen this happen for over 10 years as it's a very friendly and helpful community and it's also part of our community guidelines: https://processwire.com/talk/topic/8234-community-rules-guidelines/ πŸ˜‰ If you see anybody violating the rules just contact one of the moderators - no need to blame anybody upfront. Thx
  11. @bernhard Thanks for all the feedback! How do I duplicate those notifications? I don't recognize what I'm seeing in your screenshot. I tried ProcessWire.alert() and ProcessWire.confirm() but both are styling correctly. Hi @ryan these are just regular UIkit notifications from the Notification component: https://getuikit.com/docs/notification - Just copy this into the console of your devtools: UIkit.notification({ message: 'my-message!', status: 'primary', pos: 'top-right', timeout: 5000 }); UIkit.notification({message: 'Danger message…', status: 'danger'}); Either of the custom CSS options should enable this. Ryan, this could be the answer to all of my/our questions. The theme was marketed as being easily customisable by changing just a few css variables and I think you did a good job, but as some of the comments show the new style might be missing some. Of course anybody can look into the 3100+ lines CSS file and find the right spot to tweak. But there might be several spots that one has to override. It might be necessary to add !important to make it work. And one might forget about edge cases like RepeaterMatrix, RockPageBuilder, whatsoever. I think some main design decisions should be taken care of the style, not every developer reinventing the wheel over and over again and fixing the same issues over and over again. For the buttons it seems to be quite easy. We'd just need a CSS variable for this: .ui-button, .uk-button, .ui-button.ui-state-default, .ui-button.ui-state-hover, .pw .tox-dialog .tox-button, .pw .vex-dialog-button, .pw .vex.vex-theme-default .vex-dialog-button { border-radius: 9px; } Line 2649 of admin.css I think this is also likely a good use case for the custom CSS options. I disagree for the reasons mentioned above and I ask you 3 guys to rethink that to offer something like this: --border-radius: 10px; --input-border-radius: var(--border-radius); --button-border-radius: var(--border-radius); This means if someone wants all input/button elements have the same border radius, let's say 20px, then all he/she has to do is this: --border-radius: 20px; And if he/she wanted something like the style currently uses it would be something like this: --input-border-radius: 0; --button-border-radius: 99999px; Just tried, but it works for me. Are you missing the leading "/" before "site/", i.e. "/site/" ? Thx! Sorry, my bad! I forgot I had a very restrictive .htaccess in place that blocked access to that css file πŸ™‚ I tried both site and /site and both did not work. But now both versions do! I don't usually like having to do extra file_exists() checks, but maybe it makes sense here. Perhaps the admin custom CSS file could be pre-populated with a /site/templates/styles/admin.css or something like that so that it would be the standard it uses, unless you opt to change it to something else. Hmmm. Good point. Not sure. I think it would make things easier to have a common standard, like having a default /site/templates/styles/admin.css for example with just a few comments pointing to the example files at https://github.com/processwire/processwire/tree/dev/wire/modules/AdminTheme/AdminThemeUikit/themes/default/examples --- Another problem I just realised: My login screen is always the new style. This toggle seems to have no effect? It's not .htaccess this time... Why choose a color that isn't readable? For anything that has customizable colors, there's a responsibility to choose an appropriate color. In this case, unless you disable dark mode, you'll want to choose a color that works for both. The three predefined color options are there as good examples. Maybe we'll add separate main color choices for light and dark mode, I'm not sure, but it will still be the responsibility of the person configuring the color to choose something that is legible. Because it's the primary color of the CI. That's the whole point for having the primary color customisable, no? The backend should match the main color of the company and that's often a color that is dark to have a good contrast to white. It's not a solution to simply choose another color to make it work on dark mode 😞 Sure. We're already doing it for the PW logo, so makes sense we should for custom SVG logos as well. Great, thx! Most likely it's something that PW doesn't use, so it isn't styled, but I'm sure it can be. I think we do use uk-alert boxes, but always of a type like "primary" or "warning" or "danger", etc. So maybe we just need to add a style for alerts that aren't of a specific type. Thx. This is the code that it uses: <div class="uk-alert"> ATTENTION - RockMigrations is installed on this system. You can apply changes in the GUI as usual but if any settings are set via code in a migration file they will be overwritten on the next migration cycle! </div>
  12. As we have a new core admin style now I guess there is no need to keep AdminStyleRock alive any more, so I'm going to archive it sooner or later. Any different opinions? https://processwire.com/talk/topic/31242-new-blog-admin-theme-redesign/ As the new theme introduces a lot of issues I might keep AdminStyleRock alive. We'll see how things evolve!
  13. Hey @ryan @diogo @jploch thx for your work on this! I have some questions: 1) UIkit notifications seem to not use the theme's styling: 1.b) Is there a reason why primary buttons are black and not in the primary color? 2) Could you please add an option to make the button's border radius customisable? 3) Could you please add an option to make all input's border radius customisable? Ideally both would use the same setting by default but could be also set differently. This was one of the changes proposed by @Chris-PW when we were working on a new admin style and I think it makes sense to have everything that can take user input (<input> <textarea> <button> etc) have some rounded borders. We already have lots of lots of lines in the admin to help with grouping content, wrapping inputfields etc. and all those lines add up. Having all clickable elements look slightly different from everything else (but identical on their own) helps a lot in my opinion. 4) Is there a reason why <select>s have white background and regular inputs have a light grey? 5) Is there an option to disable the new toggles and get back to good old checkboxes? See https://axesslab.com/toggles-suck/ Even if one prefered toggles over checkboxes in general, I think there are some situations where they are absolutely counterproductive, for example here: 6) I tried do add the file site/templates/admin.css with the following content: :root { --border-color: var(--main-background); /* --inputs-background: var(--blocks-background); */ } I then put both "site/templates/admin.css" and "/site/templates/admin.css" in the AdminThemeUikit config for "Custom CSS File", but it had no effect. Strangely when I put "wire/modules/AdminTheme/AdminThemeUikit/themes/default/examples/borderless.css" it worked! I also tried with this content: div { border: 1px solid red; } Still no luck. 7) Would it be possible to have the admin theme load one CSS file by default. Similar to what we know from /site/ready.php it is often so much nicer to just place a file in a predefined location than to have to update a module's config somewhere. This might not sound like a lot to do, but when working with migrations and automated deployment workflows these things get more tedious, because you can't simply change the module config, you have to migrate these changes and then commit them. Also a predefined location reduces the risk of typos, of missing leading slashes, etc. 8 ) Where to report bugs/issues/requests? In the PW issues repo? Here in this thread? Somewhere else? 9) When editing a page in a modal (just add &modal=1 to any page edit form) there is a lot of unused space at the top: 10) On the page tree I think it is ok to have the action items text-only in this case (though I'd probably prefer the old style here): But on the trash we have some text followed by the action buttons and there this text-only style is really not good imho: 11) +1 for this: I'm using #0a2b99 for the primary color and links are near to not readable in dark mode: 12) @ryan As you can see in the screenshot above when using dark mode I'd probably want to change the logo to a white version. If that image were an <svg> this would be quite easy to do with CSS, but at the moment it is using <img src='...'> Could you probably update the theme to make it inject SVG markup for the logo directly? 13) Regular UIkit <div class='uk-alert'> are not styled properly (they use the default uikit blueish), which is even worse in dark mode: Thx!
  14. What do you mean?
  15. Hey @Bia welcome to the forum. I might be wrong but to me it sounds like you still have a wrong assumption what ProcessWire is and how it works. ProcessWire is a development tool to build websites or anything similar. You can not only build websites with it but also intranet applications, backends for single page applications, etc... That means whoever built your website did it THEIR way. Nobody else can know how the website that you are looking at works under the hood. That means if you really want/need to change anything on your website there is a 99% chance that you need to change some code for this. That also means you need access to the files of your website. That also means that you might need to understand how your website is deployed to the server. Your developer might have just copied all files to your server. But he/she might have setup an automated deployment pipeline. It also means that it would be wise to first test all your changes locally before you push them to production. Otherwise you risk to break your site and then it might be down until someone can fix it. If you don't have someone for that at hand you risk to have a very bad time with some very uncomfortable questions πŸ˜‰ But of course it also depends on the type of website you are working on. If it's not important and does not have lot of traffic this might not be a big deal... Who knows. I think in your situation it would be the best to find someone experienced to have a look at your project for maybe an hour or two that can explain to you how everything works, how it is setup and what to expect in terms of future maintenance or development and hosting. I'm not talking about how it works in detail but to get the big picture. Then you can decide how to proceed. If you want me to do that you can write me a PM or request a meeting at https://www.baumrock.com/en/contact/. There are probably cheaper options though. You can also ask for help in the jobs board or, of course you can always ask questions in the forum. It's a friendly community and answers are free, but while usually you don't wait long for answers it would probably not be the quickest way in your case. Having said all the above to answer your question: If that form is built in code you'd have to open an IDE and search for the term "Culoare:" or "Colored" or "White" in your codebase. Then you might find the file that is responsible for the dropdown. If you don't find anything in code then it means that your developer used some kind of form builder and the data is stored in the database, not in code. Hope that helps πŸ™‚
  16. Hey @HMCB the module does not offer a plug&play calendar for the frontend. Every frontend is different. Every project has different needs. One might need a month view, another project might need a list view or a weekly schedule... All these needs have been solved by libraries like https://fullcalendar.io/docs/initialize-globals so there is no need or justification for RockCalendar to reinvent the wheel. The cost/benefit calculation would clearly be negative here. But for everything behind the scenes (the backend) we have a common ground (the PW admin interface), so there you can save a lot of time and effort with RockCalendar. RockCalendar should provide all the necessary helpers though to make implementing any calendar (for example one might prefer the toast ui calendar https://ui.toast.com/tui-calendar) as easy as it can get. If you are missing anything let me know and I'll try to add it.
  17. Yeah, that's definitely on the Roadmap, but I have other priorities at the moment.
  18. I think you should also be able to send other field's data to MailerLite: https://github.com/baumrock/RockLite/blob/ce0e818cf4b7f9e5ef4cf6a0ee1244f6c291ab92/API.php#L44-L51
  19. I've read several times that slow page loads came from lots of pages being loaded into memory when loading the page. This might be due to a poorly configured page reference field (eg a selectbox with thousands of pages) or maybe another module with a totally different purpose. I think you are right that an autocomplete field should not cause any issues. I'd try to look into the debug tools first and see how many pages are loaded on that initial iframe request. You should see that in the bottom right corner if debug mode is on.
  20. I'm not sure, but I think so and that might be a good thing to add. Can you try to modify the rock.php file. There I catch any exceptions and only write the ->getMessage() output to the console. If you remove the try/catch, do you get more helpful output?
  21. Hey @Jonathan Lahijani what you provide to me might be even more vague than what RockShell provided to you πŸ˜‰ So I don't have any idea so far. What is your exception that you see? What is that one line that you get from RockShell?
  22. I don't think it's very elegant, but it works ^^ I think you can also use the GUI and click on "use one of the existing blocks" after clicking on the plus to create a new block, no?
  23. Hi @FireWire to "clone" or "mirror" a block it just needs an empty (!) php file with the same name. /site/templates/RockPageBuilder/blocks/Foo/Foo.php (all code) /site/templates/RockPageBuilder/blocks2/Foo/Foo.php (empty)
  24. +1 Docs in markdown have been working great for me. All my module docs are markdown, so they are part of the repo (could be another repo as well, as images for example bloat the module code, which is not ideal). I'm using RockFrontend's dom tools to enhance the markdown docs with some special features. That makes it possible to have working forms on my docs for RockForms, for example: https://www.baumrock.com/en/processwire/modules/rockforms/docs/ ## Working Example In this example we will build the following form. [rockforms=Quickstart] Or another example is rendering code blocks and showing copy buttons. In markdown it's just a plain code example, on the HTML page it's an interactive element with nice labels etc: ## Example This example shows how you can make every required field's label bold and add the note `optional` to every field that is not required. Note that NetteForms uses the terms `label` and `caption` for field labels. [rockforms=Optional] `label: /site/ready.php` ```php $wire->addHookBefore( "RockForms::renderField", function (HookEvent $event) { // get the field that is rendered // in netteforms its called "control" $control = $event->arguments(1); // make required fields bold if ($control->isRequired()) { $control->getLabelPrototype()->addClass('uk-text-bold'); } // add optional note if not required else { $renderer = $event->arguments(0); $label = $control->label->getText() . " <small>(optional)</small>"; $control->setCaption($renderer->html($label)); } } ); ```
Γ—
Γ—
  • Create New...