Jump to content

protro

Members
  • Posts

    66
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by protro

  1. Thank you @flydev for this example api / json request. I appreciate it because it is very clear what it is doing and it is helping me make sense of these capabilities that aren't as carefully documented in PW docs. So a huge thanks. I think a Ko-fi is in order! On the case of Svelte, it seems to be the choice framework of some devs that I have spoken with and trust. I did not realize that the Rainbowkit is React only (I saw it does support Vite though). However, I think at this point, with the little interest I have devoted to React, I choose to go the Svelte route, as it does seem the most promising. I hope that there is further ambition within web3 wallet sdks to support it as well, as it seems this would be a fantastic expansion of the currently supported frameworks. Good to know on the inertia modules being somewhat outdated. I was curious to see how some of it worked, and glad that it did. I look forward to your Vite module and what that will entail. Exciting stuff.
  2. thank you @clsource I got this working with MAMP locally (just needed to set php version below 8 to 7.4.xx). I look forward to learning about the Svelte routing and configuration. There's a lot going on here. ?
  3. updating this topic for visibility. The best tutorials and working repo I have come across so far are from 0x3 Studio: https://blog.0x3.studio/a-very-simple-to-offer-a-connect-wallet-option-for-your-website-thanks-to-rainbowkit/ The project is bootstrapped using NextJS and RainbowKit. This leaves me with some questions as to whether or not I want to integrate the functionality into a pre-existing ProcessWire site or create a Next.js SPA on a subdomain that accomplishes the functionality I am trying to achieve. It seems like there is not much documentation on working with NextJS and PW at the moment, although these modules seem to be pointing in that direction: Inertia.js for ProcessWire https://github.com/joyofpw/inertia Vue with headless PW: https://medium.com/icf-church-developers/processwire-vue-js-a-lovestory-d4d5bca365 Currently it's beyond my understanding on the best marriage with a front-end framework and/or PW either as a headless CMS, API, or non-headless, but the above examples are leading me into interesting territory.
  4. Wow @clsource thank you for making this and sharing it. Just what I was looking for in learning the possibilities of using something like Vue/React in conjunction with ProcessWire. Looking forward to trying this out.
  5. very helpful @Stefanowitsch thank you very much for pointing out those different conditions. Another awesome demonstration of Rockfrontend's capabilities ? In my case I spoke too soon and what I was actually attempting to do was to inject code into the _main.php <head> if I was on a certain template / page / etc. But because I am using the ProcessWire $config->urls->templates method to obtain the url for the script via php, I can't do that by loading an external.js file via AddIf … for example: <!-- threejs code --> <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script> <script type="importmap"> { "imports": { "three": "<?php echo $config->urls->templates?>scripts/build/three.module.js", "three/addons/": "<?php echo $config->urls->templates?>scripts/jsm/" } } </script> But then I came across a section of the Markup Regions in ProcessWire post which explained what I was attempting to do, and for me is a new discovery of ProcessWire ? So what I did was create a _main_webgl.php file and specify in my template to ignore _main.php and load this one instead. Maybe not the most elegant solution, but it is separating the logic nicely and allowing me to not have to load unnecessary scripts depending on the page / template. Very nice!
  6. Hi @bernhard is it possible to load a <script> tag or to load specific javascript file for only a specific page and/or template using Rockfrontend ? Right now _main.php is handling all scripts site-wide. Was wondering how granular this can go. Thanks for such a great module.
  7. this is outside of my usual expertise @flydev … conceptually it makes sense but I have been not the best problem-solver when it comes to determining how to handle these responses from backend -> front end. I'd like to follow best practice from security standpoint, of course … and I feel like I'm getting very much "in the weeds" meaning I may be over-complicating things, as you stated. Locally everything works fine with the env variables in my PrePros/MAMP proxy setup. It's on the production site where I am running into questions and complications, as I am trying to be as careful as possible to not leak any keys.
  8. thanks @flydev this helps. I haven't got php dotenv to work yet. I realize my API secrets were getting bundled into PrePros's JS dist bundle. I've been looking for solutions, even thought that maybe I could store it in a PW page's field, but I have hit a block when thinking of ways I'd be able to access that from within my javascript src code. Looks like with Vercel, Netlify, et al the ENV variables can be stored in their dashboard. Otherwise it looks like a proxy server for API keys on the backend is the way to go, but a little complicated for my situation.
  9. Hello PW forums, I started using Prepros after coming across it on various discussions here. I've got a local dev environment going using Prepros + MAMP server as proxy. I was curious to try this specifically for the bundling js feature. I am trying a new folder structure and wanted to experiment with some Node.js package (via npm). My project is structured: . β”œβ”€β”€ node_modules β”œβ”€β”€ src/ β”‚ └── js/ β”‚ └── main.js β”œβ”€β”€ wwwroot/ β”‚ β”œβ”€β”€ site/ β”‚ β”‚ └── templates/ β”‚ β”‚ └── scripts/ β”‚ β”‚ └── main-dist.js β”‚ β”œβ”€β”€ wire/ β”‚ └── index.php β”œβ”€β”€ .env β”œβ”€β”€ package.json └── prepros.config ProcessWire core lives in the wwwroot and is served via MAMP configured as a virtual host to that specific path and served at https://localhost:8848 via. Prepros. Because I am not spinning up npm run dev or node locally, I bundle the main.js via Prepros JS Bundle features to get a main-dist.js file that I move into the PW site/templates/scripts/ directory and which I then call in the _main.php <head> section in /site/templates/ I also specify the Global Variables in Prepros (.env variables that I want to access in main.js) const chains = [mainnet, polygon] const projectId = process.env.WALLET_CONNECT_PROJECT_ID; const alchemyKey = process.env.ALCHEMY_API_KEY; Now interestingly when Bundling JS with Prepros, it creates several named files in addition to the main-dist.js file, which I need to also include into the site/templates/scripts/ dir otherwise it I receive errors in console. I don't understand what exactly all those files are really doing other than … dependencies being bundled ? 1..prepros_main-dist.js 2..prepros_main-dist.js 3..prepros_main-dist.js 4..prepros_main-dist.js 5..prepros_main-dist.js 6..prepros_main-dist.js 7..prepros_main-dist.js Finally, the Global variables I set in Prepros do not seem to be defined when reloading the local dev/server (console errors). Is there something I am missing? This .env variable business has really taken me for a spin … especially seeing as how in production the parameters change quite substantially. I am not sure what the best practice is for production, but I seem to be trying to adhere to standard practice for local dev ? Any pointers from Prepros users much appreciated! Thanks,
  10. @flydev this Vite + ProcessWire integration sounds very promising. I would love to try this stuff out especially if it is shipped as a PW Module.
  11. Thanks @flydev … I just went on the proverbial deep-dive configuring my free version of MAMP to have multiple virtual hosts for the different sites I test, successfully getting my PW core into a wwwroot directory and freeing-up a directory level above it for a cleaner tree-structure similar to yours: now onto some ES6+ module testing.
  12. @flydev, thank you for taking the time to demonstrate so thoroughly. Right off the bat I can see that you Dev environment differs from my MAMP setup in that the PW core files are contained within wwwroot, which in my environment (with multiple sites) I have placed the PW core within their respective htdocs -> project_name_sub_directories, with no corresponding directory level above the PW core, whereas I see in your case you have wwwroot with all PW core, but then a structure above for node_modules, src, etc. I think this is getting to one of my main confusions in my own dev environment. In which case, this might be the time to try our DDEV as @bernhard and others have documented nicely. Perhaps this will be more suitable to my situation. With regards to the wallet connectivity module, many thanks for illustrating such a detailed example. I will be having a deeper look at this.
  13. Well this certainly opened up a can of worms for me. Following some of the advice from this thread, it seems to be a preference of many PW Devs to not use package managers, so I decided this would be a good way to go because * package managers' file structure conflict with ProcessWire's default permissions (irc only files in /site/ are accessible, so this would negate a node_modules directory in the root) * I prefer a simple / manual approach as was described in the above thread with regard to package managers. When it came to trying the alchemy-sdk, I was running into problems with ES6+ syntax / import statements. e.g. Uncaught SyntaxError: Cannot use import statement outside a module. So I guess I'll back up and ask, how are people who do use package managers doing that with PW, given its strict permissions? Secondarily, do I need to also use something like Babel/Webpack to transpile the alchemy-sdk code for distribution ? Feeling confused, and any help is appreciated.
  14. I am using Vanilla JS/PHP on the frontend. It's interesting you recommend Alchemy, I'll look into their sdk again. From what I remember their documentation was based on React, which seems to be the framework of choice for a lot of web3. I've felt disinclined to learn / build with it based of off feedback from other developers that I know and respect. This is all promising to hear you think it's not too heavy a lift with to integrate this stuff into ProcessWire so I will begin again with a fresh set of eyes.
  15. Thank you @flydev for your response. Just to get it out of the way I am a big fan of your Duplicator PW module. It has made a world of difference in my development work. Thank you for releasing that. What I am interested to do is less to authenticate users to sign-in to a backend, and moreso to successfully connect to their wallet, and then if they are in possession of one of our tokens, to display some pages and/or media on the front end that a non-token holder would be unable to view. I am not interested in cold wallets at this time, mostly curious about MetaMask because it is the most popular for Ethereum. I had looked at Web3-Onboard which you mention. Will look into the other libraries you listed. Good starting place.
  16. Greetings ProcessWire forums, I was curious if anyone has built a crypto hot wallet connect / sign-in feature to their PW sites? I am interested in the possibilities of such an integration into one of our project's websites. The only thing I am finding is this, but it just seems to be marketing fluff and I find it not trustworthy: https://blockchain.miniorange.com/crypto-wallet-login-and-nft-token-gating/processwire/ I am interested in learning more how MetaMask and/or Phantom wallet could be managed from a ProcessWire perspective.
  17. @bernhard thank you very much for suggesting the defer option as the culprit. It seems to have fixed the FOUC content flashes I was encountering. Looking forward to upgrading my existing sites to the latest Rockfrontend … I saw your note about breaking changes if I am jumping from v 2.3 -> 3.x.x. I will keep an eye out for those.
  18. I seem to be having a recurring FOUC (Flash of Unstyled Content) issue when developing with ProcessWire, Rockfrontend, and UIKit 3, and I'm not sure what the best approach is. I am using the `uk-animation-fade` and on my local MAMP development environment with Chrome and Brave I am getting flashes of the content before the markup properly fades in. Any help, advice, or methodologies are greatly appreciated.
  19. Hi, I am using @bernhard Rockfrontend with the Latte engine and wanted to create a custom latte filter called firstParagraph that grabs the first <p> from a field called body. in _init.php I added the following: // Include the Latte template engine library require_once '../modules/RockFrontend/vendor/latte/latte/src/Latte/Engine.php'; // Create a new instance of the Latte engine $latte = new \Latte\Engine; // first paragraph summary filter $latte->addFilter('firstParagraph', function ($s) { if (preg_match('/<p.*?>(.*?)<\/p>/', $s, $matches)) { return $matches[1]; } return ''; }); But I get a Fatal Error Trait "Latte\Strict" not found (line 18 of site/modules/RockFrontend/vendor/latte/latte/src/Latte/Engine.php) Am I going about this the wrong way? Any help/feedback appreciated.
  20. I seem to be running into an issue where woff2 fonts that I have manually added to site/templates/webfonts directory are triggering livereload in an endless loop every second. I tried setting the livereload config to have a longer interval, e.g. '2', but this seemed to stop livereload from registering changes entirely. $config->livereload = ['interval' => 2]; The Livereload logs shows (at random) one of several woff2 files repeatedly. Is there something I am missing with regard to adding fonts? Should I exclude the webfonts directory from livereload, and if so, what is the proper syntax for doing so using the 'exclude' parameter ? Thanks @bernhard
  21. Using Rockfrontend + Latte, I was able to add an external link using the navmenu by writing a condition if the page title matched a string: {* build the menu *} {foreach $navItems as $item} <li n:class="$rockfrontend->isActive($item) ? uk-active"> {if $item == $home} <a href="{$item->url}">Home</span></a> {elseif $item->title == "MyMenuItem"} <a href="https://example.com" target="_blank">{$item->title}</span></a> {else} <a href="{$item->url}">{$item->title}</span></a> {/if} </li> {/foreach}
  22. Thanks @bernhard the modules refresh did the trick. Appreciate your quick reply.
  23. How can I safely update the UIkit version? Do I re-install uikit profile in the Rockfrontend module and then that repopulates the Download UIkit dropdown menu? My issue is that I updated Rockfrontend fine but the versions of UIkit available to me are stuck at 3.16.15 as the latest version.
  24. Nevermind I realize now that it's pulling from the file field description // default title source and formatting: $titleOut = $mp3->description ?: $mp3->name; // default $titleAtt = $mp3->description ?: $mp3->name; // attribute
  25. Thanks @Macrura, Also is there a way to pass in a Page's fields to control to Bar-UI Track Title Template if I didn't want to rely on ID3 tags? What are these tokens {title} referencing ? <span itemprop="name">{title}</span>
Γ—
Γ—
  • Create New...