Jump to content

Jonathan Lahijani

Members
  • Posts

    633
  • Joined

  • Last visited

  • Days Won

    24

Jonathan Lahijani last won the day on April 23

Jonathan Lahijani had the most liked content!

4 Followers

Profile Information

  • Gender
    Male
  • Location
    Los Angeles, CA

Recent Profile Visitors

14,062 profile views

Jonathan Lahijani's Achievements

Hero Member

Hero Member (6/6)

1.7k

Reputation

1

Community Answers

  1. If you truly want to make an admin theme from scratch like I'm doing, it's best to just take AdminThemeUikit, since that is the "official" and most supported theme and rip out UIkit and start replacing it with your own approach and just hack away at it. Keep in mind that ProcessWire makes heavy use of jQuery UI and a few other libraries so you'll have to play nicely with them unless you want to replace them too, but that takes it to another level. With Bootstrap, it's straight-forward enough given the similarities with UIkit, although this is turning out to be more work than I anticipated. But that was the point since I want it to force me into looking at how everything is interconnected. One idea for an admin theme is to do it with pure, modern CSS and as little JS as possible and as accessible as possible (good reason why here).
  2. @Mustafa-Online I made nice update today on this module after not having touched it in several weeks. It's now basically complete but before I release it I still need to clean up some old code that's left over, make it work more nicely with SelectizeAll and provide similar overriding capabilities that the UIkit theme has. This module includes Bootstrap Icons and it substitutes Font Awesome icons accordingly (I went through each one and found the equivalents!). It also uses the Bootstrap navbar and dropdowns. A side-effect of this is ajax-loaded dropdown content won't work in the first release. I may backtrack on using Bootstrap dropdowns depending on if that becomes difficult. Anyway, it's looking good overall. If anyone is wondering why use this as opposed to UIkit, it may be beneficial if you are doing a lot of custom admin stuff and want to use pre-made Bootstrap styled components since the Bootstrap ecosystem is much much larger than UIkit. Also, it feels a little more fresh, although my actual reason for creating this was to for a way for me to get a deeper understanding of how admin themes work.
  3. @ryan @Pete Can we get this fixed? Or if you'd like, I can help maintain this site.
  4. I wanted to start a conversation about other systems out there that are "ProcessWire-like", meaning they also go all in on everything being a custom field, similar database architecture and other things that make ProcessWire seem unique. What makes ProcessWire unique to you that you just haven't seen elsewhere and how deep does ProcessWire go with certain decisions or features that other systems don't from your experience? One very recent system in the JS world that's similar (at least on the surface, I've never worked with it) is Payload CMS: https://payloadcms.com/
  5. If I'm understanding this correctly, this would mean all of ProcessWire would have to be open-source, meaning the commercial modules, correct? Related.
  6. Thanks for releasing this Ryan. Although I've been using ProcessWire daily for over a decade at this point, it's nice to compare my version of "The ProcessWire Way" with that of the creator himself and learn any tips and tricks along the way. This is probably going to be very helpful for beginners. When I was researching Tailwind a while ago, the creator (Adam Wathan) spoke about how he made many demo videos of himself replicating websites with his CSS framework so developers could get an idea of how the creator of the tool himself would approach using it. I feel like these site profiles provide a similar and more realistic learning experience in addition to ProcessWire's great documentation.
  7. For those who want to block the vendor folder using ProcessWire's main htaccess file, here's a snippet: https://github.com/processwire/processwire-requests/issues/191#issuecomment-1969214984
  8. With Geffen Playhouse for example, which was launched in 2019 right before custom fields for files/images was introduced, we needed custom fields for images. At the time, the best approach was to use the RepeaterImages module, which uses repeaters and all the functionality that comes with it. This includes the ability enable/disable a repeater item. In a recent update, I wanted to remove that dependency and switch to just a normal images field with custom fields, but the client still wanted enable/disable capability on images, hence my approach to it described in this post. I think about it just like repeaters. There are times when you want a piece of data to exist but not be visible. Without being able to disable an image, you would have to delete it (or do some other weird hack like perhaps add an image tag), which is less than ideal. With enable/disable capability, it brings it more in line with how multi-item fields, like repeaters, work.
  9. As of today, this is now a native feature on the dev branch: https://github.com/processwire/processwire-requests/issues/520#issuecomment-1961794624
  10. Lets say you have an multi-image field named 'images' and you want to be able to mark one or more images as disabled as well as make it visually appear as disabled in the admin. Currently, ProcessWire does not support this natively (requested here), however we can still easily achieve this with using custom fields for files/images, introduced in PW 3.0.142, as well as a hook to achieve the visual effect. Follow these steps (modify as needed): create a checkbox field called 'disabled' create a template called 'field-images' which will ProcessWire will detect as a custom template for the 'images' field add the 'disabled' field to that template add the following code to /site/templates/admin.php $wire->addHookAfter('InputfieldImage::renderItem', function(HookEvent $event) { if($event->object->name!='images') return; if(!$event->arguments('pagefile')->disabled) return; $event->return = "<div style='opacity:.2'>{$event->return}</div>"; }); Of course, if you don't want to display disabled images on your frontend, make sure to update your selector on your 'images' field, like so: // before (will still select disabled images) foreach($page->images as $image) { ... } // after (will ignore disabled images) foreach($page->images->find("disabled=0") as $image) { ... }
  11. As of today on the dev branch, this is now possible with a new hookable method InputfieldPage::renderPageLabel() https://github.com/processwire/processwire-requests/issues/460
  12. Hey there fellow Angeleno, Let's assume you have a bunch of 'video' pages with a 'file' field where the single video gets uploaded and another field called 'file_transcoded' that contains the transcoded/sized-down version. You could create an external script that bootstraps into ProcessWire, loops through each page where 'file_transcoded' doesn't exist (meaning it hasn't been acted upon yet), run ffmpeg on it, take the transcoded file and add it to file_transcoded ($page->file_transcoded->add($transcoded_file)), save and repeat for all the other non transcoded pages. That external script could be run using a cronjob. I believe you can do a background process or queue however I don't have experience with that in the context of ProcessWire yet although it's been discussed. The approach I mentioned keeps all the files in the natural /site/assets/files/(page-id)/ directory. I think the main point here is that where the original video files precisely exist is irrelevant as long as you use the $pages API which will take care of that for you.
  13. Because I don't write JS often, hold my nose when I do, and since it's usually for little tweaks or UI adjustments, my knowledge of the syntax and weirdness of the language overall doesn't seem to stick (how do I add a class to a div again in vanilla JS?). Google is not so great because oftentimes the information is outdated on Stack Overflow results and requires a lot of sifting. However ChatGPT is phenomenal with JavaScript (and jQuery) if you want develop AND learn at the same time. Seriously a game changer for me. Unfortunately it's not so great for AutoHotkey, or at least it seems to keep giving me v1 code as opposed to v2 despite telling it to give me v2, but that's OK because it still provides some guidance which I supplement with AHKs documentation.
  14. Indeed. Pico CSS, which is a minimal CSS framework, takes that approach: https://v2.picocss.com/docs https://v2.picocss.com/docs/accordion I wish they supported tabs however.
  15. I would think that in ProcessWire, you would be able to do this natively: $users->get("name=bob")->logout(); Guess I'll write my own method in /site/classes/UserPage.php
×
×
  • Create New...