Jump to content

Ivan Gretsky

Members
  • Posts

    1,487
  • Joined

  • Last visited

  • Days Won

    16

Posts posted by Ivan Gretsky

  1. Good day everybody!

    I am trying to use wire404() in ready.php. The function throws an exception, but it is not caught with PW the standard way. The 404 page is not displayed  but an error page is displayed instead. I guess that the hook to catch the exception is defined later in the request handling lifecycle.

    1. Am I right or is it something else?
    2. Can I somehow make PW catch this exception in ready.php? (in fact it doesn't work in template prepend file like _init.php either, but I need it earlier)
    3. If 2 cannot be achieved, what is a proper way to work this around and return a 404 page with 404 http code manually? 

    Thanks in advance!

    P.S. The 4th of April was not so long ago so this might relate)))

  2. Big thanks for this, @teppo!

    This was supposed to be a New Year present judging by the date. I was away and could not receive it. Luckily we have an Old New Year here in Russia, so the present is still very much on time))))

    1. I have quickly checked this new feature. Seems exactly what I was describing as the first option. It works great for template views. It didn't for Component views, but it seems I could fix it with this PR. I am not sure partials work ok yet. Will check later. What else should I check?
    2. I would love to have an option to configure Wireframe to not use default view files are used in case a prefixed version doesn't exist. This way it would be easier to find out what else should be overridden when creating themes. I guess the best thing would be to have 3 options here:
      1. Use default view files are used in case a prefixed version doesn't exist.
      2. Through an error in case a prefixed version doesn't exist.
      3. Output nothing in case a prefixed version doesn't exist.
    3. It would be great to have the second option from my OP one day, but this solves my current demands 100%. Really cool!

    Again, big thanks for this! I love the way you improve Wireframe taking our input into account. And it really amazing how we all can create the software together these days) We often take this for granted, but it is really a miracle looking at it from back in the days))

     

     

    • Like 1
  3. @teppo, just in case you are in doubt what is that what you can gift to the world this New Year, I am quite sure the world will be delighted with the new Wireframe version with themes support))

    Well, maybe not the whole world, but certainly some minor parts of it)))

    I do not know how do to say "happy upcoming New Year" in English or Suomi, so I'll put it here in Russian: "С наступающим!"

    • Like 1
  4. On 9/9/2024 at 1:12 PM, bernhard said:

    Done!

    Here is the link for everybody to submit a review 🙂 https://www.softaculous.com/review/ProcessWire

    If you are short on time: https://www.softaculous.com/rate/ProcessWire

    Both without registration!

    I have done this. Hope it will get some more deserved attention to PW. And this post is supposed to bring this pinned topic up in the recently updated list for those who, like myself, read the news there. And to get some more  for us on github)

    • Like 1
  5. On 11/6/2024 at 9:41 PM, kongondo said:

    Anyone got xdebug + WSL2 + DDEV + VScode working please? I have read the tut in the DDEV docs but it is not working for me.

    1. In VSCode the Xdebug session starts. On the website Xdebug doesn't kick in. 
    2. After a while, VSCode breakpoints turn transparent and hovering over them says 'invalid breakpoint' or something like that.
    3. I did attempt all the WSL-related troubleshooting in the DDEV docs, e.g. the telnet connection. Was hoping for a question here.
    4. After a while VSCode says port 9003 closed.
    5. Sometimes I see notifications from ProcessWire (e.g. headers already sent) in the debug output.
    6. I am not sure whether and how to append the port number 9003 to the ddev url. E.g. mysite.ddev.site:9003. If I do this, the website hangs (chrome website cannot be reached).

    Any ideas?

    Thanks!

    Good day, @kongondo! Have you managed to get it to work?

    P.S. I have managed to make it work both for web and cli. The only thing that I still cannot figure out is how to launch a specific php file (see an example without ddev below). Still can't find out how to start it not with php but with ddev exec php.

            {
                "name": "Launch test.php",
                "type": "php",
                "request": "launch",
                "program": "${workspaceFolder}/test.php",
                "cwd": "${workspaceFolder}",
                "port": 0,
                "runtimeArgs": [
                    "-dxdebug.start_with_request=yes"
                ],
                "env": {
                    "XDEBUG_MODE": "debug,develop",
                    "XDEBUG_CONFIG": "client_port=${port}"
                }
            }

    I have tries adding "runtimeExecutable": "ddev exec php", but it didn't work for some reason:

    Error: spawn ddev exec php ENOENT
        at ChildProcess._handle.onexit (node:internal/child_process:285:19)
        at onErrorNT (node:internal/child_process:483:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
      errno: -2,
      code: 'ENOENT',
      syscall: 'spawn ddev exec php',
      path: 'ddev exec php',
      spawnargs: [
        '-dxdebug.start_with_request=yes',
        '...',
        '...'
      ]
    }

     

  6. 10 hours ago, Alexander said:

    While this post is not intended to be an advertisement, if someone from community is facing challenges related to online fraud, user spam, or security, please feel free to contact me directly.

    Thanks for an interesting perspective and for the commendation @Alexander! As you already mentioned your new open source thing, expand on it for everybody. We are in the Pub anyway))

    • Like 2
  7. Ok. Now I got it better, I think. Now I have _init.php prepending wireframe.php that generates settings array, that I then pass to wireframe->render(). Some absolutely general settings I pass down with setting() function.

    If we had composers, we could move all my code in _init.php and wireframe.php to a dedicated class.

    Where would these composers be in places if file structure? How would we access data from them in views?

  8. 1 hour ago, teppo said:

    hat being said, the first one sounds like an easy to implement thing as well. I'll have to take a closer look at the code to be sure.

    Great! Looking forward to see it in Wireframe! Thanks for your work and talent!

  9. 1 hour ago, teppo said:

    you can override some features, but those that have not been overridden are the same as in the "parent theme" — right

    Yes. But I think there could be an option to either use parent's features or to indicate that this one is yet to be implemented in a theme (through an error or warning).

  10. Good day @teppo!

    Another question from me)

    I am building a solution based on PW and Wireframe, that needs the theming functionality. That is switching theme (default views) for all the views and components. Layouts and partials probably too. Is there an easy way to achieve this with current code? Maybe a couple of hooks?

    I can see two ways how it could work.

    1. Put `alternative-default.php` everywhere the `default.php` files are and somehow tell Wireframe to use those prefixed files. If there is another view except the default one, the prefix should work as well. Like `alternative-json.php`. Probably an option should be available whether to fallback to defaults without the prefix or not.
    2. Create an overrides or theme folder somewhere and have somehow point Wireframe to use views from there.

    For my personal need the 1st approach seems to be a better one. But just maybe it is easy enough to provide possibility for both?

    Thanks!

    • Like 1
  11. On 12/1/2024 at 1:37 PM, teppo said:

    One of these is Composers, likely similar to what they've got in the Sage theme for WordPress: https://roots.io/sage/docs/composers/.

    Thanks for sharing. I am still wrapping my head around the concept. I it passing variables to a specific view... seems like it. But I am not sure I quite understand what problem does it solve. If you would like to discuss it, a real-world example would help)

  12. How are you doing, @kongondo!

    Your module is a blast! Still finding some really cool ways to use it to control how menus could be controlled from the admin.

    The thing that really worries me is that the module seems to be not fully compatible with newer versions of php.

    Is there a chance you could find some time to upgrade it anytime soon? Or are you willing to accept PRs with fixes? I can see one that is not dealt with yet, so curious if me or someone else should try to come up with solutions with compatibility problems?

    Thanks!

  13. Good day, @Robin S! Thanks for the module! I've used it with a great pleasure on my single-language sites. But now I need to set things up for the ML site. How would you suggest to do that?

    I think I would need both language-dependant labels AND urls. Is it better to handle this with hooks, or there could be a way to do it from the UI?

  14. Good day @teppo!

    How is it going? I am using Wireframe as a basis for almost all sites I work with. So really hope you're doing fine) Are there any new great plans for this module?

    There is a function to create Wireframe folder structure from admin. I was wondering could it be done via API? Need this for a setup script. I know it is not hard to create folders in cli, but a one liner using API would be just neat.

  15. Thanks for a great explanation (as always). I guessed almost everything) I also place the source scss/js in templates/static. Before that I used to put the sources in site/static-src and put the generated files in templates/static. I guess, resources could be a better name for the sources. At least it is a standard place to have them as I use Wireframe (and love it).

    • Like 1
×
×
  • Create New...