Leaderboard
Popular Content
Showing content with the highest reputation on 03/02/2024 in all areas
-
There are a few commits on the dev branch this week, but nothing particularly notable. I had to do some client work this week but also ventured back into the Invoice site profile, which I mentioned quite awhile ago, but hadn't yet released. I'm hoping to finish that up and release it as another site profile option for ProcessWire very soon. Perhaps as soon as next week. I had originally planned on building out that Invoice site profile quite a bit more, but having used it for my own invoices for many months (maybe a year?), I think it's better to keep it simple. Otherwise I'd be making assumptions about what others might need. Even in its relatively simple state, it suits my own needs well. And I think if it gets more complex, then people are less likely to explore and modify it, making it less useful as a site profile. The site profile is also simple enough right now that it doesn't need to be a Pro module or need Pro-module support. Since we don't have a lot of site profiles to choose from, I'd rather keep it free. It is admittedly more of a mini application than a website, which is why I think it might bring some more diversity to the available site profiles. Chances are it won't replace whatever invoice service you might be using, but I think it's still pretty useful, whether using it to create invoices, or just using it to explore more of ProcessWire. More next week. Have a great weekend!6 points
-
Hi Everyone! So I've been working with PW for over ten years now!!! Big thanks to @ryan and everyone in the community (genuinely such a warm community). I've made a few modules in my time as well as tutorials and this was the first that I thought might work as a commercial module: MembersMessaging This module enables you to easily setup a messaging system for your users through your site. Allow your website users to message other users on the site given a user name or similar information. Module uses the notions of threads, messages and users to describe the message relationship -> A thread is a page storing n messages including: time posted, created by user and message text, the user ids in that thread, which users have unread messages in that thread, whether messages are encrypted (and it's salt). User pages have a list of all threads they are apart. In your templates you can add: a compose message form, threads and their messages, thread reply forms, message and threads counts, as well as delete and delete all messages. You can view messages in the admin (unless encrypted set to True) and view message stats and module usage in admin page Members. Purchase here How to install? - Install Processwire - Add MembersMessagingModule folder to modules folder in processwire: /site/modules/ - Login to your site admin and navigate to Modules: yoursite.com/[admin]/module - Configure the module settings: yoursite.com/[admin]/module/edit?name=MembersMessaging` - Follow the instructions below to add messaging to your templates How to use Example usage: $mm = $modules->getModule("MembersMessaging"); echo $mm->execute(); echo $mm->js(); echo $mm->css(); Full api here. Configuration Module allows you to configure whether: to allow new threads to yourself to allow new threads to guest user role to trash or unpublish threads deleted from frontend to use select or textinput for username input to allow an All keyword to signal thread should include all users to change all keyword to something else to notify a user via email they have been sent a new message to set email sender address to change username output from user name field to some other field specified to change default max threads and messages to display to encrypt messages (using basic encrypt strategy that encrypts each message on server before DB save, and is decrypted on request) Roadmap: Available here. ------- I'm not really sure how much interest there would be in this module so I've posted it to GumRoad for now, but will be looking to work on a PW store front if theres any interest in it and other modules - I've got ideas for other modules such as deffered page publishing, image folder GUI, protected field, field dependencies, pages contraits. I'm also available for hire currently to work on sites or modules https://www.benbyford.com3 points
-
FieldtypeFormSelect lets you create fields to select from forms created using the pro FormBuilder module. Features: Create select fields that allow for choosing forms when editing pages Fully compatible with FormBuilder, render forms using native methods Choose which forms will be available to choose from, each field is configured individually Choose how form names will be presented in select elements Compatible with FormBuilderHtmx FieldtypeFormSelect lets you create fields like this, configured as desired. Choose which forms will be present. Including forms where names start/end or contain a value allows you to create a form select field once then use form names to help group them together, or add/remove them from form selects without editing the field. This is also a pretty simple way to allow end users to create forms that will be selectable without having to edit a field configuration. For example, this field will only allow you to choose forms having names ending with "request", so "customer-support-request" and "consultation-request" will be included, but where forms with names like "newsletter-signup" and "call-to-action" won't. Choose how you would like the form names to be presented in the select element. They can be shown as they are originally named, as spaced words, or as capitalized/spaced words. Rendering in your templates is straightforward <?php $page->select_a_form; // => A form ID, or null if no form has been selected // Render using the native FormBuilder method echo $forms->render($page->select_a_form); // Alternate method. Selected form will be rendered, if no form is selected output is null. echo $page->render('select_a_form'); Form select fields store the ID of the selected form and FieldtypeFormSelect makes use of ProcessWire's built-in field rendering to keep things simple. The fields you create will always be up-to-date with the forms as they currently exist. If a form is deleted that has been selected in one or more fields, those values will be set to null so you won't experience any issues with references to form IDs that no longer exist. Your templates and pages stay free from errors. My primary use is to have a form select field available for blocks created in the RockPageBuilder module by @bernhard. I want each section on the page to contain an option to choose any form that will open in a modal to put the power of choosing forms in the hands of the user. RockPageBuilder is not required, but makes for a powerful example. Contributions and issues are welcome on Github, or stop by here for some help! Install as a ProcessWire module Install via Composer Download from the Github repository Cheers!2 points
-
2 points
-
I think you're making my point here- you're a graphic designer who has learned web. That means you're a web designer. Please don't take what I said as a negative towards graphic designers. What I'm explaining is that there are distinct roles. I can design and create a UI but I'm under no delusion that I have the talent of so many graphic designers I've met- and you are probably included in that group of professionals. I've worked with award winning designers at ad agencies for clients across the US, and they are phenomenal but still had much to learn when we worked together on web projects. This is by no means any insult or speaking badly of them, and they understood the work we needed to do together. I'm referencing graphic designers who aren't web designers. One is not more important than the other whatsoever! We can agree that a graphic designer doesn't have to test the poster they designed to make sure it works on mobile. I would never expect that printing a website I made out on a poster would be even remotely the same thing. In fact, please don't. It would look really bad. So when I say that I haven't met a graphic designer who knows web design, it's because if they did- they would be a web designer, in context of designing a website. Please don't take what I've said in a conversation about a web implementation on a web developer related forum as something that it isn't, and I apologize if I came off as aggressive or insulting. My comments were meant to address the original post and nothing more. So, I apologize if my comments came off as rude or dismissive.2 points
-
All props to Jan! The PW people are definitely not an easy crowd for a page builder, but PAGEGRID is very well integrated in the system, with all the content that you add to the page saved as PW pages (a bit like with repeaters). Also, with PAGEGRID being just a PW field, like any other, you don't lose any of the flexibility of PW. It's not for everyone — it won't appeal to pure developers that don't care so much about design, and because it requires some knowledge of how CSS works, it may also not appeal to designers who don't care at all about the platform. Hopefully, there will be enough people in that middle who will appreciate it ?2 points
-
Hi all, I'm happy to share with you this website we launched two weeks ago for a Swiss movie in pre-production phase. The client wanted to have a blog to document the project and allow users to contribute posts through a form but also with a login to the admin which — once approved — gives them access to more options for their contribution’s content. Right at the beginning they came to us with scientific visualizations as references and thus I finally got to try D3.js. I’ve known about it for a very long time but never got a chance to try it out. It wasn’t easy but in the end I managed to get (what I think is) a pretty satisfying result. And here is a sample of the modules we used: - Fluency ⭐ - TracyDebugger - FormBuilder - RepeaterMatrix - AdminRestrictBranch - FieldtypeOembed - PageRenameOptions - MarkupComponents - Login Magic Link: this is a new one allowing to login with a link sent to the user’s email (inspired by this thread). It’s almost ready to share but I want to create a Process to have an overview of the generated links first Enjoy!1 point
-
Thanks for this – I've been using FieldtypeForms for years, which was just a gist https://gist.github.com/craigrodway/7515600 there may be another one here: but much appreciated that you have made an official module for this, I use the form select module to allow site editors to select a form to show in a configurable page builder section.1 point
-
Clearly I didn't make my point efficiently. I would hope the heavy use of emojis could even point out the lightheartedness of what I was writing. I referred to Cargo because people were talking about it, the idea was not to defend it on this particular situation but to try show a different side of it that people might have missed. To make it clear, I do agree that it's not the best tool to use for a client, and I admit that I went on a tangent to the conversation. That said, I would like to point out one or two things: Wow, I have to say, I'm finding it really hard to believe this whole paragraph, but this statement is particularly mind boggling. Of course I believe what you're saying is true, but, being originally a graphic designer myself and having worked for the web with many others, all I can assume is that you are meeting the wrong graphic designers. Graphic design, or design in general, is not just about artistry and creativity, but a very technical craft. I genuinely feel that you are not paying the same respect to another profession as you are demanding for your own.1 point
-
1 point
-
@fruid Use custom page classes. In site/classes: <?php namespace ProcessWire; class UserPage extends User { public function getMessages(): PageArray { return wire()->pages->find('template=message, receiver=' . $this->id); } } Be sure to enable it in site/config.php: $config->usePageClasses = true;1 point
-
On the dev branch this week we have a good collection of issue fixes and feature requests. The dev branch commit log has all the details. One feature added this week which I think could come in very handy is #520 (via @Jonathan Lahijani) which adds the ability to hide individual images in an images field. When an image is hidden, you can see and work with it in the admin, but it gets removed from the field value on the front-end of the site at runtime, effectively hiding it. I know I'll use this a lot, particularly on photo galleries where I may want to remove an image or two from appearing in the grid of photos, but don't necessarily want to delete them. Images can be hidden (or unhidden) from the Actions select of each image, where you'll see a "Hide" option (or an "Unhide" option if the image is already hidden). Hidden images are also dimmed out when viewing the images field in the admin. On the API side, you can hide or unhide images and files using $image->hidden(true) to hide, $image->hidden(false) to unhide, and $image->hidden() to get a true or false as to whether or not the image is hidden. Though this will only be useful on unformatted field values, since hidden images are automatically removed from formatted field values. The same can be used with regular file fields, but we don't currently have a UI/interface for hiding or unhiding items from regular (non-image) file fields. Likely we'll add one soon, but I figured it's likely to get more use with image fields than file fields, so figured we'd start there. More next week. Thanks for reading and have a great weekend!1 point
-
hi @Martin Muzatko i would recommend you read the docs about hooks carefully: https://processwire.com/api/hooks (especially here: https://processwire.com/api/hooks/#add_new_method ) to your problem: try this: public function getMessagesBySender($event) { $user = $event->object; $sender = $event->arguments[0]; $event->return = $user->getMessages()->find('sender='.$sender); } you could also modify your getMessages method to take an argument as selector and then use it like this: $user->getMessages("sender=$user"); // additional tip: double quotes makes it easier to read sometimes ;) regarding the "event system": $event in the hooks is the hookevent object. you could call it whatever you want, but as it's called $event everywhere in PW it's good to stay with this naming. the object is needed by PW and it's hook system so you cannot just "return" from inside the method. or to be more clear: you can just return but then it will not change anything. thats the way how you can do early exits: $wire->addHookAfter('Pages::added', function($myHookEvent) { $page = $myHookEvent->arguments(0); if($page->template != 'mytemplate') return; // example of early exit [...] } here i named $event differently just as a showcase. the $event->return property holds the "value" of the hooked method. this can be different things, for example a PageArray if you hook a page find operation or a simple string if you hook a field's value. This value is only one thing that is needed by processwire to fully execute the request. For example there is also the $event->replace property that would tell PW to completely replace the hooked method if it was set to TRUE - so pw would not call the original method after the hook was executed (this only works on before-hooks, of course). https://processwire.com/api/hooks/#replace_method hope this makes sense for you. i would also recommend using tracy debugger - it's a lot more powerful and easier to read than var_dump1 point
-
And I was not here! Very nice example of usage of ProcessWire modules. Even after months, I love it!1 point
-
Ah ha! Thanks guys! This is fantastic and really helps me to make better modules with better integration. Thanks, again.1 point
-
Haha, I knew I had to be fast, this was such a great question. I don't want anyone to believe building modules for PW is hard, it's not.1 point
-
/site/modules/UserExtension.module <?php class UserExtension extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'User Extension', 'version' => 101, 'summary' => 'Extends $user object.', 'singular' => true, 'autoload' => true, ); } public function init() { $this->addHook('User::sendThankYou', $this, 'sendThankYou'); } public function sendThankYou($event) { $user = $event->data['object']; $event->return = "Thank you, $user->name"; } } Usage is dead simple: <?php echo $user->sendThankYou() ?>1 point