Jump to content

Ivan Gretsky

  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Ivan Gretsky

  1. Nice to have this conversation going on) Thanks @Jonathan Lahijani! The 1st approach There is probably a room for each of the approaches. For now I am always using the 2nd one. It is the easiest for non-technical people and I have them in the admin. I do not think that I will ever use the 1st approach as it is. It is too complicated and too closely coupled with the markup IMHO. Not unless we make it more visual. To do it, we need at least 1, 2 and 9 from this list. The 2nd approach I can see how the 2nd approach could be made more configurable. You said earlier you're using Mystique for the options. I would've build option sets for different option groups: Оne for the section, dealing with section background, margins, width and so on. One for the grid, making columns proportions adjustable (50/50, 30/70, 33/33/33, 25/25/50 and so on). That option set should be limited by the pre-defined number of columns for block, so you wouldn't have 33/33/33 for a block that only should be displayed in 2 columns grid. Option sets for image and text (for the example in the video). The easiest way to implement those option sets is having them in separate Mystique fields. But they also probably could be merged into one general options field using this (hope I understood it right, didn't try it). Using separate fields would bring the benefit of positioning options next to corresponding items (like putting image options next to image field). I understand that this could be a lot of work to configure those option sets, but that could pay off in the long run. The main downside to 2nd approach is that you cannot easily and visually change elements' position/order. Like making image+text field a field+image. Or adding another column making it text+image+text. The 3rd approach I like the idea of using the 3rd approach, but I do not like the implementation. It indeed looks kind of hacky. I would stay closer to RM basic functionality, though extend it. I think that there could be a neat way to make it if @ryanwould help us here. We would need to implement no. 1 (and 2)))) from this list (Make possible to define allowed children for the matrix types.) This would make 1s approach more solid, but also help us with the third. So we would only allow image and text block under image+text. We would need to make possible creating groups of blocks from add block button. So when we add image+text block image and text blocks are automatically created under it. Might be already possible with hooks. We need to think what happens when we move one of the child blocks somewhere else, so there would be only text under image+text and no text. Or make it impossible to move them out of that nesting. Or teach our content managers to not do it (worst scenario)) Well, lots of hacks needed too) But at least the text and image blocks are under the parent block and are manageable the same way as others. --- There are other possible approaches. Probably Johnathan already thought/tried them, but putting them here for more alternatives. The 1+3 approach Let's have only general section block with options (no rows and columns) and content blocks. Content blocks can (but not should) go under section. If they are NOT under section, they display as full width. If there are more than 1 content blocks under section, they are displayed in columns. If you add 4 - there are 4 columns. Widths are adjustable on the content block label. If there are more than 100% of total width, they are displayed in 2 rows. Still we need no. 1 and 2 from this list to not allow content blocks be nested under each other. The Repeater/RM inside RM approach The name says it. Image and text blocks are inside of a RM nested inside Image+text field. Lots of extra fields, lots of configs, but I do it sometimes.
  2. Good evening (at least here where I'm at))! Wireframe has a lot of files named the same way (default.php). When working with multiple files in an IDE (read "all the time") it is hard to distinguish between tabs as they are all named the same. At least it is in VS Code due to this issue. I am used to give files meaningful (bul long) names. I used to have templates/views/home/home.view.php instead of templates/views/home/default.php. Files are better searcheable this way too. Do you know any workarounds? Could it be worth it to have default filenames in Wireframe have configurable patterns, so that something like templates/views/home/home.view.php was possible?
  3. In the project I am working on right now login and logout are handled with simple procedural code in _init.php on page reload. What would be the best way to do this in Wireframe? Put this code in bootstrap file (templates/wireframe.php)? This doesn't look pretty and in line with how everything else is structured. Have a common controller and subclass it? How would this work for templates that do not have controllers? Use built-in custom classes? What would you suggest?
  4. Thanks for the thorough answer, @teppo! For now it is done in the code. As I said, I've been using a variation of Wire Render Pattern approach. The template file in this approach is kind of like a controller. I've set layout and sublayout vars in _init.php to the most used values and overrode them in template files. In _main.php I've passed template-specific content string to sublayout and then the whole thing to the layout. Most of the times I only had one layout - a skeleton with html, head, body, script tags + counters and a place to include a sublayout. Everything else went to sublayouts and views. In my current project this makes a lot of sense as there is completely different markup in different areas of the site (including different header and footer), but the assets (css and most of the js) are common for all areas. So it is comfortable to have common things in the layout, all the variable chrome in sublayouts, and template-specific stuff in the views.
  5. Maybe css vars could help. Thanks for the insights. I finally understood that colors can be set as primary instead of blue in the config) But still all examples I've seen do use named colors. I guess it is a trade-off of using utility-first approach.
  6. Nope. I was talking about the ability to apply different styles to the same markup for easy customization. Like you have your primary color as blue and the client wants to have it green. Or you want to override color just for a part of the site.
  7. Is tailwind suitable for theming somehow? Same markup, different styles? I would guess it is not. But maybe I am missing something?
  8. I've searched the API reference for $pages and couldn't find the description for $pages->newPage(). Should it be there?
  9. Good day! I am getting into Wireframe and liking it a lot. But I still have a lot to figure out. Before Wireframe I was using something I called a sublayout. My <head>, opening and closing <body> tags and all the stuff before the latter, like 3rd party marketing tags and js, were all in a skeleton.layout.php file. This file was common for all pages. Templates had their views, but they were not included directly in the skeleton.layout.php but rather in one of the few sublayout files, which also held some extra markup, common to groups of templates. I usually had at least 2 of them - one for the homepage, and another one for all the rest. But sometimes there were more of them. I came up with this concept trying to imitate twig's template inheritance feature. I am not using twig and do not want a templating language in my projects (yet?), but want something similar. And sublayouts was my approach to it. I also did research things like plates, but never used nothing. Now I am thinking, what would be the best approach to handle this with Wireframe. I can see these options: Using twig via renderers. But I am still not sold on bringing it into my projects. Making 2 or more layouts and including the upper and lower part as partials. But I do not like to have this base template code split around a few files. This way it seems harder to deal with the code. But just maybe there are other options to configure Wireframe to do what I am after using its hidden powers?
  10. I am running this action just like any other. But it does end up with an error (which I am trying to debug) and a Bluescreen (Redscreen would be a better term here))). I do not see this on any other actions I run, though I didn't try to make them end with an error. I does show only when I am running it and get an error.
  11. Good day, @adrian! I am debugging an Admin Action (yes, another module of your's)). I get an error and try to debug with bd(). I can see the Tracy bar and the dumps count appear. But then I hover the cart with dumps popup doesn't show. Actually no popups in the bar work. I get this message in the browser dev tools console: I also notice, that the Tracy code is added to the document twice: Why can that happen? Tracy seem to work as it should on other pages.
  12. Hello, @horst! What a great module you've presented us, the community, with! I've got it on each and every of my sites, and it is working so good I rarely think it is there. Only when you have questions you remember it exists. So this is the time to express gratitude. Thank you very much! I am now moving my dev environment to the cloud to a VPS server. I want to have all my mail from that server to be caught and not to be sent away. So I started searching for solution and found MailHog. I've setup this program with the instructions from here. As far as I understand it, I've replaced sendmail with a substitute (mhsendmail) via sendmail_path setting in my php.ini file. That substitute program should redirect smtp messages to MailHog instead of the intended target. When I test sending smtp from the cli, it works as I was expecting. But when I send real forms from dev site, it does not. My understanding of what is happening when WireMail does its job is close to non-existent ?. Could you please explain, should WireMail use this sendmail_path setting, or does it work some other way and it does not affect it? And do you know any other way to achieve mail catching that I described earlier on a dev server? Thanks! --- P.S. I really think that 15 pages of great answers is too much for anyone to handle. Recently @teppomanaged to move his Wireframe's support to a dedicated forum thread. I am sure this module should have one too. Ask @Pete if you agree.
  13. Here it is! Great! Now it must be easier to start with Wireframe from a blank slate installation.
  14. Good day, @teppo! Why isn't the module in the PW modules directory yet? Are there any reasons for it not to be there?
  15. Can it be ProcessWire could be listed there? Do we have anything to contribute?
  16. Sorry for resurrecting this topic. But I think my question is related yet (not exactly the same). If I clone a page, set new title and save it under the target parent, that already has a page with a same name as generated from that title, the name doesn't receive an increment. But it rather is set to the name of the default page, that was cloned, with an increment. Let me explain on example: I've got page with a name template under Templates parent page. Then I clone it, set it's name to an empty string, set some title (e.g. example) and save under another page Destination. The cloned page under Destination gets name example. Then I clone another page from template, set it the same title (example), and save it under Destination. I am hoping to see it receive a name example-2, but it is saved as template-2 instead. I guess that is happening because when I clone a page it runs that setupNew method before I assign a title to it. The question is: is there a way to use the same in-built logic for handling duplicate names when cloning pages?
  17. Whoa! I was getting a screen like this so often I thought it is like it should be) Right now I've got a FormBuilderProcessor::formSubmitSuccess hook in ready.php. Inside it i call $this instead of the variable name. And get this behavior. But as I said I was getting it soo many times before... Next time I'll notice it I'll report back again.
  18. Good day! I need to show more than 15 items in the call stack. There must be a setting for this, but I can't find it) I need to see what's there between 14 and 37))
  19. Most of us have been through this. You start not knowing anything and do most of things by trial and error. But at the end you come out stronger and more knowledgeable. I do not think there is a shortcut here. To learn something is to find yourself in the place of ignorance first. You should solve your tasks one by one, searching the forum, reading the code, asking the community if you get stuck. I do not think anyone is "too beginner". But everyone has to start from where he is at. There are a lot of docs, great forum posts and other resources spread around. but there is probably not a single tutorial to complete and become a ProcessWire master. Take you time, be patient, have fun along the way)) P.S. And just to address you specific questions a bit, I would recommend you this link... and many more here - just search for "create form")))
  20. That is just awesome! Why did I never seen it in the docs? Is it even there?
  21. Any would do for me) But maybe a border from one side could be enough? Top or left. Another option would be a warning sign icon to the left of the TRACY label with a popup, describing why it is here (kind of like Server Type Indicator).
  22. Thanks for making this video @Jonathan Lahijani! There is a lot to study from it. Let me ask one question right away. How did you changed the block colors? Is that already build in like Ryan said it would, or is it with custom css for now?
  23. Thanks, @adrian and @teppo! This is great way to handle it, as we can override this setting in config-dev.php. By the way, where can we find all the config options available for Tracy? It could be beneficial to have some kind of color indication for this in Tracy bar, so we won't forget to change the setting if we're on prod. Something like a color flag. What do you think?
  • Create New...