Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/01/2024 in all areas

  1. Hello all- FieldtypeFormSelect does what the post title says it does. Lets you create a field to select a form created by the FormBuilder pro module. This type of field (or some variation of it) has probably been done elsewhere but I put this together with a few extra considerations for flexibility and utility. When creating a form select field you can choose what forms will be present and how their names will be shown. Let's go to the pictures: A form select field: Creating fields to choose from specific forms? You have options. You can also create a field that will only include forms that begin, include, or end with a specific string. This allows you to create a field once, then use form names to help group them together and add/remove them from form select elements 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 ever edit a field configuration. For example, this field will only allow you to choose forms having names enting with "request", so "customer-support-request" and "consultation-request" will be included, but "newsletter-signup" and "call-to-action" won't. You can also choose how the form names will be presented in the select element. They can be shown as they are originally named, as spaced words, or as capitalized/spaced words. So, how does this field work? Form select fields store the ID of the form you select, but it also has a nice trick for working with forms in your markup too. FieldtypeFormSelect makes use of ProcessWire's built-in field rendering to keep things simple. Let's go to the code. <?php $page->select_a_form; // => Outputs the form ID, or null if no form has been selected // You could do this to output your form markup echo $forms->render($page->select_a_form); // Or you can do it this way. If a form has been selected the markup will be output to the page, if no form is selected, the output will be null. echo $page->render('select_a_form'); The fields you create will always be up-to-date with the forms that have been created in FormBuilder. This module also keeps things tidy- if a form is deleted that has been selected in one or more fields, on one or more pages, the values for those fields will be set to null so you won't experience any reference errors to form IDs that no longer exist. My primary use is to have a form select field available for blocks created in the RockPageBuilder module by @bernhard. I wanted each section on the page to contain an option to include a call to action button that can be a link to a page, a link to another URL, or that can open a modal with a call to action form to capture leads and visitor contact information. It's a great way to easily add flexibility and give some extra power to the end user when considering what they want visitors to do when browsing their website. RockPageBuilder is not required, but makes for a useful example! Protip for website designers- in my experience and empirical study of conversion analytics for sites that I've built, buttons located within sections of content on the page captured more leads and outperformed a call-to-action button in the page header, the call-to-action form at the bottom of the page, and forms located on a "Contact Us" page- by far. The true purpose of this field is to get the right forms in the right places quickly and easily without any need to work around markup output strategies or short codes. Contributions on Github are welcome if there's some extra functionality anyone wants to add that makes sense. Please let me know if you run into any bugs as well, when there's some extra usage and testing I'll submit it to the modules directory. Hope you find it useful! https://github.com/SkyLundy/FieldtypeFormSelect
    11 points
  2. 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!
    11 points
  3. 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.com
    5 points
  4. Hey! I would like to announce that there is a new ProcessWire powered collaboration between me and Jan Ploch 👉 @jploch. When I moved to Hamburg, I contacted him through the forum and we ended up working at the same shared office. Meanwhile we collaborated on some projects and then started our own company (a GbR, in Germany). We named it KONKAT Studio. Now we are publishing our brand new website konkat.studio As you may know, Jan developed a page builder for ProcessWire called PAGEGRID. At first, we were going to develop our website the usual way, but then we decided that we should take PAGEGRID for a spin and beat the hell out of it, to see what we could come up with 😄 We had this idea of three rows scrolling in different directions, and because PAGEGRID has scroll animations built in, we managed to do it all without writing a line of code. We may write a case study soon for those who are interested.
    4 points
  5. Hi everyone. Padloper 009 is ready! The release has been delayed by issues with my site. It is currently offline as I work on upgrading it. I hit a number of issues which I am currently resolving. I am hoping this won't extend beyond two weeks. I request your patience please, thanks. Best.
    2 points
  6. Thanks again for catching the font issue @monollonom! Actually it was not Haas Grotesque causing the problem with the vertical metric. The problem was that the font was not loading at all, probably due to the file being corrupted and you were probably seeing the Helvetica present on your computer. This also must have happened when transferring the site to the server. Thanks again!
    2 points
  7. Congratulations to both of you! I wish you all the best as well. Small note: it seems the font you’re using has a (rather common) vertical metrics issue on Firefox leading to your text being cut by the overflow: hidden You can learn more / test your font here: https://vertical-metrics.netlify.app/ and then maybe get in touch to see if this can be fixed by the type foundry
    2 points
  8. 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
  9. I don't think anyone was knocking Cargo per se, just that according to OP, it didn't satisfy the requirements that the client had already stated to begin with. I will second @da² in that I also had pages on the Cargo site that appeared to be broken and wouldn't load for me. This is definitely an important distinction. It must be stated that the client is asking a professional web developer for a solution, not an artist. If they want to make an internet art piece, then they can. If they want a website that actually does something, like get new business opportunities, I hardly think that a graphic designer that thinks doing fancy font work could pull it off. I've never met a graphic designer that knew what the optimum width, in character count, text content should be for a user experience. They also couldn't explain when to use a .png or a .jpg. They don't think about things like variable background image size ratios, why text in an image is a bad idea, how people's experience looking at a print postcard differs from a website- simply stated, why something that looks really pretty can actually be a bad thing. Obviously the web doesn't have to be ugly- but the web demands more that aesthetics. If a client doesn't know about this- we educate them. If after hearing what we have to say they decide they don't care, that's the grave they're ready to dig for themselves. I have a close friend who works for a company that just got sued for lack of accessibility on their website last week. I also know that a manager there demanded that their preferences dictate how the site looked, now they get to deal with the repercussions. Probably going to cost them $10k in settlement money, then legal fees on top of that, and however much they'll be paying someone to fix their site. I'm on the side of the developer and I believe we have a profession that is constantly challenged by people who have been lulled into a false sense of "my opinion is as good as your facts". Having said all of that- if this is a company that simply does not care about anything other than creating high art on the internet- then they don't need a web designer/developer professional, they need to go find software like they did to create posters- or just put a .jpg up as their home page.
    1 point
  10. @hellomoto It looks like you are building a custom Fieldtype? If so, can you paste in the contents of your getDatabaseSchema() method? Matching an empty value can depend on the schema, though usually is handled by an OR condition that matches an empty string or the non-presence of a row. Matching the non presence of a row is done by performing a LEFT JOIN on the field_* table along with a WHERE condition that matches "IS NULL field_table_name.pages_id". It can be a little tricky, so luckily PW handles this situation for you internally, and doesn't require your Fieldtype to handle it unless you tell PW that you want it to… To describe further, ProcessWire matches empty values automatically, and so may not even call your getMatchQuery() for most empty-value matching selectors. But if PW isn't correctly matching it for you, then you may need to implement your own "empty" match logic. PW asks your Fieldtype::isEmptyValue() method (if implemented) if you would like to handle that situation (details). If it sends a Selector object to your isEmptyValue() method and your method returns true, then you are telling PW you want to handle matching the empty value: public function isEmptyValue(Field $field, $value) { if($value instanceof Selector) { // tells PW your getMatchQuery will match empty values return true; } return parent::isEmptyValue($field, $value); } So if you have a method in your Fieldtype like above, then your getMatchQuery() would have to have logic to match an empty value. I don't think your current getMatchQuery() would correctly match an empty value, so I'd need to see the schema to identify what would be needed.
    1 point
  11. @diogo PAGEGRID also looks amazing by the way. I don't have much experience with page builders, but it seems like PAGEGRID is really well thought out and does everything you could want.
    1 point
  12. I don't how to do this, but by exploring HTML source of the repeater items in admin page (browser dev tools), looking InputfieldWrapper API and InputfieldRepeater API, and var_dumping things in a hook, I found a way. self::addHookAfter("Inputfield(name=championshipRoundRepeater)::processInput", function (HookEvent $event) { /** @var InputfieldRepeater $inputfieldRepeater */ $inputfieldRepeater = $event->object; /** @var InputfieldWrapper $wrapper */ foreach ($inputfieldRepeater->getWrappers() as $repeaterItemId => $wrapper) { /** @var Inputfield $itemField */ $itemField = $wrapper->getByName("title_repeater$repeaterItemId"); $itemField->error('this is an error'); } });
    1 point
  13. Change the form method to "GET" and on the home page create links to URLs like "/case-studies/?selected=telecom"
    1 point
  14. Yes the site is terrible and full of bugs, I even had page freezes, not sure they really want their CMS to be used. 😄
    1 point
  15. Thanks Ryan! We just take the vertical scroll position and convert it to translateX values on the rows, using requestAnimationFrame() to make it smooth. Well, PAGEGRID is doing it 🙂. There was a second <html> added by $config->prependTemplateFile. We forgot to remove it when we moved it from local to a new install in the server 🤣 Thanks for catching this! Thanks Romain! Thanks for catching the problem with the font. For now we added a max-height only for Firefox using @-moz-document url-prefix(). We'll see if there's another version of Neue Haas Grotesk that doesn't have this problem.
    1 point
  16. There is a difference between: field does NOT exist in template field does exist but has NO value You can check a lot with is defined - see here: https://twig.symfony.com/doc/3.x/tests/defined.html {% if page.field is defined %} ... {% endif %} Another thing in TemplateEngineFactory / Twig you can uncheck Strict variables to make life a bit easier. Yet another thing could be your include is out of scope and you might need to include with instead - see here: https://twig.symfony.com/doc/3.x/tags/include.html {% set vars = {'foo': 'bar'} %} {% include 'template.html' with vars %}
    1 point
  17. I'll chip in some thoughts here, and this is from a perspective of caring about you @titanium in this situation. Well... they're graphic designers, not web designers. I've lead a web team and trained graphic designers to become web designers because they are not remotely the same. I always take the route of asking questions- a lot of them- because I wouldn't be able to make an accurate recommendation without understanding their needs. So I'd ask about more specifics about their design, view a mockup if they have one, understand what they're asking for because it does sound to me like they're asking for the moon. It's a moment where people reveal their level of expertise, or lack thereof, in the first sentence of their request. Sounds like they want * { position: absolute; } This is why I always operate with this thought in mind: what a client asks for does not have intrinsic correlation with what they need, or even want to begin with. Maybe they actually could achieve what they want using sane tools like @bernhard's builder. I'm sure there are more specifics to your situation and I'm not sure of the relationship you have with this client, but I would be concerned that they're going to end up trying to do something that isn't possible, or is so remotely possible that it's not worth their time, or yours. It might be worthwhile to ask yourself: Is this client expecting something that can't be done that may get you stuck in a position where you can't deliver? You're the expert in this field. Wix, Squarespace, GoDaddy Website Builder (lol), etc. They all fundamentally build in blocks with all of the standard limitations of the web. If they want to be big kid web designers then the onus of finding a tool that lets them do what we do is their job, in my most humblest of opinions.
    1 point
  18. This is the part that I was most confused about. The post goes to detail about trivial stuff such as how to create a zip file, but then simply states that... They make it sound super easy, and obviously it is when you are both the attacker and the victim, but that has little to do with real world. Of course MITM is a serious threat and systems should be configured properly and users should be educated about risks of e.g. connecting via public wifis, but it's not something you can just pull off like it was nothing. And yes, any system that allows the user to directly execute code or upload files that are executed as code is technically "vulnerable" once you gain access to those features. That being said, I do see some potential for improvement here. For an example I think the default settings for moduleInstall should be as strict as possible, and I'm also wondering if ProcessWire could do light-weight scanning of obviously dangerous actions? Something like checking if an uploaded module/PHP file contains exec/eval/etc. or base64 encoded values, and at least displaying a warning to the user. Not sure if that's really feasible or particularly useful, though, and it could no doubt be circumvented by a targeted attack. Just a rough idea 🤷‍♂️
    1 point
  19. I wonder if @ryan was ever contacted about this. I've tried to come up with a scenario where the URL injection mentioned in the CVE can become exploitable, but I'm having a hard time. When you can intercept a communication to that level and modify the message body, you could just forge the necessary requests, supply them with the intercepted session information and use the built-in module upload functionality. That's why we have DANE, so the communication stays confidential even if you're routed through untrustworthy networks. I've sent a rejection request to MITRE with the following rationale:
    1 point
  20. What would happen if anybody uploaded such a zip to a regular user's file field? It would still be a zip, right? Isn't there a setting to automatically unzip on upload? Would that be a problem? I guess no, right? It would just unzip it and then we'd have a .php file in the field, but I think that would need to be allowed in the field settings. And even if allowed I don't think pw would at any time execute this file?
    1 point
  21. Me neither 🙂 I had to write the script because https://pagespeed.web.dev/ complained about my multiple files.
    0 points
×
×
  • Create New...