Jump to content

Andi

Members
  • Posts

    62
  • Joined

  • Days Won

    1

Everything posted by Andi

  1. Some screenshots (dark mode): Screenshots (light mode): Screenshots (forced dark/light mode on sections):
  2. Hey there, for the last couple days I've been playing around with Pico CSS after reading about it in @Jonathan Lahijani's post over here I'm really liking the framework and thought it would be a great fit for smaller PW Projects, so I've put together a small site profile as a starting point for people who'd like to try it out. This is by no means a production ready site, so just be aware of that when you install it somewhere πŸ™‚ @Juergen has generously offered to include native Pico support in his FrontendForms Module and already implemented the core functionality in his latest update, so I included a very basic contact form showcasing the new Pico2 framework option on the contact page. Also, I've added a few other 3rd-party modules in the download, these are currently @bernhard's awesome RockFrontend, because I don't think I could live without Latte ever again @adrian's Tracy Debugger because it's the first thing I install on every project @Robin S's really handy MinimalFieldset for the hero section repeater I've never actually released a site profile here so I hope it's ok to ship with these modules preinstalled. If not please drop me a line and I'll change that asap. Unfortunately I do not have a GitHub account so I'll attach a .zip file for now. Actually not 100% sure about the official procedure here 😁 If you have any suggestions for improvements, or if you encounter any problems during installation, feel free to leave a comment here. Also, people who actually know JS please don't hate me for the implementation of the theme switcher. At least it's working, and it actually doesn't flicker on page load like it does on the official Pico website πŸ˜‰ All the best from Regensburg and if you're in Germany, happy holiday! Download: site-picowire-v3.zip
  3. Hey @MarkE, I know the feeling πŸ™‚ If you want to make absolutely sure, I'd suggest making a Duplicator copy of the entire site, install it on your live environment, using a subdomain and a different database.. Then update that site and see if it fixes things.. Just don't get confused with the different installations πŸ˜„
  4. Hey @MarkE, maybe try running the latest PW dev version on your live rig, I seem to remember something being patched about page classes in one of the latest updates. If I can find it, I'll post it here. Here's the issue... I remember having trouble with that on a live setup a few weeks back πŸ™‚ https://github.com/processwire/processwire-issues/issues/1862
  5. Haha, really cool @Juergen, but wasn't it supposed to be weekend? πŸ˜„ Working nicely over here, and now configuration really is a breeze! One little thing I've come across during testing, if I disable HTML5 validation and just submit an empty form, the success message gets printed below the error (see Screenshot 1). Steps to reproduce: Framework -> Pico2 Field code: // disable html5 validation $form->setHtml5Validation(false); // add name field $name = new \FrontendForms\InputText('name'); $name->setAttribute("placeholder", "Name"); $name->setRule('required')->setCustomMessage('Please enter your name'); $name->setSuccessMessage('Looking good!'); $form->add($name); And the resulting HTML, after submitting an empty form: <input id="contactform-name" name="contactform-name" type="text" class="input input-error" placeholder="Name" required="" aria-invalid="true" aria-errormessage="contactform-name-errormsg"> <small class="error" id="contactform-name-errormsg">Please enter your name</small> <small class="valid">Looking good!</small> When entering a value, everything's working as expected (see Screenshot 2). Really glad you like Pico! Just found out about it myself a few days ago in this post by @Jonathan Lahijani and I think it 's going to make a great fit for smaller PW projects. All the best and have a nice weekend, coding or otherwise πŸ˜‰
  6. Ok that seems to do it πŸ™‚ Awesome @Juergen, thanks a bunch!! From the top of my head, one use case I could think of would be something like "Username is available" or something along these lines... Other than that, I totally agree. Great stuff, thanks again!
  7. Hi @Juergen, I'm basically trying to get FrontendForms to play along nicely with Pico CSS, which I've recently come to love. This is more or less what I'm trying to achieve (from the official documentation) <!-- validation passed --> <input ... aria-invalid="false" aria-describedby="valid-helper" ...> <small id="valid-helper">Looks good!</small> <!-- validation failed --> <input ... aria-invalid="true" aria-describedby="invalid-helper" ...> <small id="invalid-helper">Please provide a valid value!</small> Not sure about the actual standard here, though.. Maybe an option to add attributes to valid/invalid input fields could generally be helpful? Beste Grüße and many thanks! And good luck with the hook issue, I'll keep playing around on my end and see if I can find anything.
  8. Hey @Juergen, thanks for your answer. Setting the tags manually per field works fine for now! When playing around with some of the example code earlier I noticed that none of the hooks from the docs seemed to catch on. I thought that had something to do with my setup here somehow.. But this is already very helpful πŸ™‚ On another topic, is there a way to add an attribute to a field that has an error? After running through validation these classes are being added to the input field <input ... class="input input-error" ...> If I'd like to add say a <input ... class="input input-error" aria-invalid="true" ...> Would that be possible or would I need to do it via hook as well? Many thanks again!!
  9. Hey @Juergen, trying this out for the first time here, really cool module! I'm wondering is there a way to change or remove the wrapper for error messages? Somewhat similar to $form->useInputWrapper(false); If try to add $name->setRule('required')->setCustomMessage('Please enter your name'); $name->getErrorMessage()->prepend('<small>')->append('</small>'); I'm getting <small> <p class="error">Please enter your name</p> </small> So basically I'm trying to ditch the <p class="error"> tag for something different. Is that currently possible or would I have to fiddle with the returned string in some way? Thanks in advance and all the best from Regensburg!
  10. Thanks for the insights @bernhard, so about the loading order That's the part I was wondering about, since it used to be the other way around in earlier version of RF, as far as I remember. I was wondering if that was an intentional change. Just autoloading the UIKit CSS and JS files (without defer) in the current build gives me pretty bad FOUC and Firefox complaining If I reverse the order by disabling autoload and rendering the assets manually those Firefox warnings disappear, and I feel like the pages render a lot smoother in FF. As for other libs I'm using on a regular basis, at least Leaflet is pretty specific about the loading order of CSS and JS, see here https://leafletjs.com/examples/quick-start/ But I guess that too could be handled via the "defer" method you described earlier. Just need to keep it in mind πŸ˜„
  11. Hey @bernhard, just updated a site to Rockfrontend 3.13.1 and noticed that auto-loading assets via $rockfrontend->styles()->add('foo.css'); $rockfrontend->scripts()->add('bar.js'); now has the order reversed in the generated markup. <script src='bar.js?m=1712642262'></script> <link href='foo.css?m=1713850912' rel='stylesheet'> Which in case of using UIKit is probably not ideal, since in my understanding the CSS should be loaded before the JS. Can you reproduce this or is something messed up on my part? Also, on a live site and with debug mode off, RF still renders a tag <script>var RockFrontend = {"isDDEV":false}</script> in the html head, wonder if that is necessary or what the purpose of that could be. Any pointers here? Not using RockFrontend.js if that's related in any way. Greetings to Austria and thanks in advance! πŸ™‚
  12. Awesome news, can't wait to try this. Thank you guys for the effort!!
  13. All good, that seems to have done it πŸ™‚ Glad I could help & thanks for the support!
  14. Somehow i feel like getPath is doing it's thing correctly..., It's supposed to return false if the path is not valid, or am I getting confused here? πŸ™‚ But in AssetsArray.php -> addAll(), there seems to be a check missing for $path. If I change that to public function addAll($path, $suffix = '', $levels = 2, $ext = ['js']) { /** @var RockFrontend $rf */ $rf = $this->wire('modules')->get('RockFrontend'); bd($path, 'before'); $path = $rf->getPath($path); bd($path, 'after'); if (!$path) return; // ******* <-- add this line ********* $files = $this->wire->files->find($path, [ 'recursive' => $levels, 'extensions' => $ext, ]); foreach ($files as $f) $this->add($f, $suffix); return $this; } The errors are gone... Although I'm not quite sure about what to return there πŸ™‚
  15. So, back on this. If I create an empty folder "site/templates/layouts", there's only two errors coming up.. So I guess for the 3 directories that do not exist, instead of not doing anything, the script somehow falls back to trying to look up files in the server root '/site/templates/layouts' <-- does not exist, error 1 '/site/templates/sections' <-- exists '/site/templates/partials' <-- exists '/site/assets/RockMatrix' <-- does not exist, error 2 '/site/assets/RockPageBuilder' <-- does not exist, error 3 Let me know if you need anything else and thanks again! RF is really fantastic already, and loving the new features.
  16. Error is still there on 2.1.10 unfortunately.. Here's the bd.. I need to run now but I'll happily provide more information later today. '/home/sites/XXXXXXXXX/public/site/templates/site/templates/layouts' '/home/sites/XXXXXXXXX/public/site/assets/site/templates/layouts' '/home/sites/XXXXXXXXX/public/site/templates/layouts' '/home/sites/XXXXXXXXX/public/site/templates/site/templates/sections' '/home/sites/XXXXXXXXX/public/site/assets/site/templates/sections' '/home/sites/XXXXXXXXX/public/site/templates/sections' '/home/sites/XXXXXXXXX/public/site/templates/site/templates/partials' '/home/sites/XXXXXXXXX/public/site/assets/site/templates/partials' '/home/sites/XXXXXXXXX/public/site/templates/partials' '/home/sites/XXXXXXXXX/public/site/templates/site/assets/RockMatrix' '/home/sites/XXXXXXXXX/public/site/assets/site/assets/RockMatrix' '/home/sites/XXXXXXXXX/public/site/assets/RockMatrix' '/home/sites/XXXXXXXXX/public/site/templates/site/assets/RockPageBuilder' '/home/sites/XXXXXXXXX/public/site/assets/site/assets/RockPageBuilder' '/home/sites/XXXXXXXXX/public/site/assets/RockPageBuilder' Thanks a bunch!
  17. before '/site/templates/layouts' after false before '/site/templates/sections' after '/home/sites/XXXXXXX/public/site/templates/sections/' before '/site/templates/partials' after '/home/sites/XXXXXXX/public/site/templates/partials/' before '/site/assets/RockMatrix' after false before '/site/assets/RockPageBuilder' after false
  18. Ok so a little more info.. It seems RF is trying to add styles from StylesArray->addAll("/site/templates/layouts") Although I'm currently not using layouts on the site. Then also from StylesArray->addAll("/site/assets/RockMatrix") and StylesArray->addAll("/site/assets/RockPageBuilder") which I don't have installed on this setup, maybe that helps...
  19. Hey and thanks. So that gives me 5 dumps, 3 of which look similar to this one array 0 => array 'file' => '/site/modules/RockFrontend/AssetsArray.php:69' 'call' => 'WireFileTools $files->find("/", [ 2, array(2) ])' <--- this seems to be causing trouble 1 => array 'file' => '/site/modules/RockFrontend/StylesArray.php:28' 'call' => 'StylesArray->addAll(false, "", 2, [ 'css', 'less' ])' 2 => array 'file' => '/site/modules/RockFrontend/RockFrontend.module.php:513' 'call' => 'StylesArray->addAll("/site/templates/layouts")' 3 => array 'file' => '/site/modules/RockFrontend/RockFrontend.module.php:266' 'call' => '$rockfrontend->autoload(Page $obj)' 4 => array 'file' => '/wire/modules/Process/ProcessPageView.module:184' 'call' => 'Page $settings->render()' 5 => array 'file' => '/wire/modules/Process/ProcessPageView.module:114' 'call' => 'ProcessPageView $process->renderPage(Page $obj, PagesRequest $obj)' 6 => array 'file' => '/index.php:55' 'call' => 'ProcessPageView $process->execute([ true ])' The other ones look like this 0 => array 'file' => '/site/modules/RockFrontend/AssetsArray.php:69' 'call' => 'WireFileTools $files->find("/home/sites/XXXXX/web/XXXXXX/public/site/templates/sections/", [ 2, array(2) ])' ... So somehow AssetsArray.php seems to be looking for something in the server root, although I have no idea what exactly, and why πŸ˜„ I'll investigate further.. Many thanks for the pointers @bernhard
  20. Hey @bernhard, after deploying from ddev to a live server Tracy is giving me 3 errors per page load (frontend only) like this: PHP Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/sites/XXXXXXXXXXXX/:/tmp/:/dev/:/usr/share/php/:/etc/ssl/certs/:/usr/lib64/php8.0/bin/) in .../XXXXXXXXXXXXXX/public/wire/core/WireFileTools.php:765 I wasn't even sure if Rockfrontend was the culprit here, but I checked two versions. On 2.0.7 Tracy gave me the error twice, while on 2.1.5 it's three times per page.. We're on a shared hosting plan with this project, not sure how to go about this.. Any idea what could be going on there?
  21. Hey @kaz, in /site/modules/FieldtypeLeafletMapMarker/InputfieldLeafletMapMarker.module try changing line 193 f. if( ((string) round($lat, $precision)) != ((string) round($this->defaultLat, $precision)) || ((string) round($lng, $precision)) != ((string) round($this->defaultLng, $precision))) { to if( ((string) round(floatval($lat), $precision)) != ((string) round(floatval($this->defaultLat), $precision)) || ((string) round(floatval($lng), $precision)) != ((string) round(floatval($this->defaultLng), $precision))) { that's hotfixing the issue over here. Don't know about the rest of the module, but I haven't gotten other errors so far.
  22. @bernhard you're on fire ? Looks great but I'm currently on a self-hosted Gitea instance, and it looks like they're not planning on supporting Github Actions anytime soon.. https://github.com/go-gitea/gitea/issues/12673#issuecomment-684968986 Thanks for the heads up though, I'll keep an eye on RM!
  23. @bernhard Trying this on a test project currently, I'm wondering if there's an easy way to add pages to RockFrontend the same way you're doing with $home. Let's say, I normally have a /contact/ page, stored in $contact, holding all possible information, phone numbers, social media links etc., and I'd like to make that page available in all rendered files. Right now, unless I'm missing something, I could use custom variables to pass to $rockfrontend->render(), but that doesn't seem to work with ->renderLayout().. The other minor issue I'm having, if you use Alfred on an empty text block, you don't get the edit links, the whole block just disappears. Other than that, very nice work, feels really good to be using Latte again ?
  24. If you're following the steps above, don't forget (like I did earlier) to make the bash script executable.. In Step 6, after editing your post-recieve file $ cd /var/www/myproject-git/hooks $ chmod u+x post-receive Very cool guide @gebeer, I was toying around with a webhook from Gitea calling on a local php script earlier today, which runs okay, but this seems way more elegant.. And definitely easier to set up ? Thanks!
  25. Just a quick note, if you're on Linux & Code-OSS and have trouble opening your ALFRED / Tracy links to directly edit template code (around 34:00 in the video), you need to create a separate URL handler for vscode:// type links in ~/.local/share/applications create a file code-oss-vscode-url-handler.desktop #!/usr/bin/env xdg-open [Desktop Entry] Name=Code - OSS - VSCode URL Handler Comment=Handles opening of vscode:// URLs in Code-OSS GenericName=Text Editor Exec=/usr/bin/code-oss --open-url %U Icon=code-oss Type=Application NoDisplay=true StartupNotify=true StartupWMClass=Code - OSS Categories=Utility;TextEditor;Development;IDE; MimeType=x-scheme-handler/vscode Keywords=vscode; Terminal=false Borrowed from here: https://github.com/Microsoft/vscode/issues/48528#issuecomment-414056547 And Alfred is your new best pal ?
Γ—
Γ—
  • Create New...