Jump to content

3fingers

Members
  • Posts

    437
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by 3fingers

  1. So I recall, and still waiting ? It was on top of his list but... EDIT: https://processwire.com/blog/posts/roadmap-2017/#whats-in-store-for-processwire-in-2017
  2. Some quotes missing here I think. Probably for the previous issue?
  3. I reply to you since nobody else does ? The motivation behind this silence is that in the past there was a similar thread in which someone else raised the same questions, regarding themes and a marketplace eventually. Short answer is no, most of the users here in the forum don't rely on theme market (as far as I remember, personally I design them from scratch). Same goes as having a starting point for processwire, due to the fact I build heterogeneous sites where it's kinda rare I feel the need for something different than a blank profile. Tailwind css rules ??
  4. Hello Mate, a while back I've made a video on how I usually approach usage of Tailwind with Pw, you can find it here. Nowaday, with Tailwind v.3.x I've changed my approach slightly, since some additional postcss packages are already included. Below my updated package.json file, in order to better understand which scripts I invoke: { "devDependencies": { "cross-env": "^7.0.2", "cssnano": "^4.1.10", "laravel-mix": "^6.0.41", "postcss": "^8.4.5", "postcss-import": "^14.0.2", "postcss-preset-env": "^7.2.3", "tailwindcss": "^3.0.18" }, "dependencies": { "concurrently": "^7.0.0", "postcss-cli": "^9.1.0" }, "scripts": { "start": "npx tailwindcss build -i styles/entry.pcss -o styles/dist/dist.css", "watch": "concurrently \"npx postcss styles/entry.pcss -o styles/dist/dist.css --watch\" \" npx mix watch \"", "build": "concurrently \"cross-env NODE_ENV=production npx postcss styles/entry.pcss -o styles/dist/dist.css\" \"npx mix --production\"" } } Basically I rely on tailwindcss cli to kickoff the first compilation of my entry point, then I invoke postcss --watch and mix watch (for js). At build time I switch node environment to production (which cssnano the final css) and mix --production to finalize my js (minification, module resolving, etc.). For completion here is the postcss.config.js: const cssnano = require('cssnano'); module.exports = () => ({ plugins: [ require('postcss-import'), require('tailwindcss/nesting'), require('tailwindcss'), require('autoprefixer'), require('postcss-preset-env')({ features: { 'nesting-rules': false } }), ...(process.env.NODE_ENV === 'production' ? [cssnano] : []) ] });
  5. Take a look here: https://processwire.com/blog/posts/pw-3.0.141/#example-1-changing-the-templates-directory
  6. Hello all, as title suggests I'm facing an issue where findRaw() doesn't recognise file fields, they are completely ignored. Is it something already issued? Is there a workaround for this? Thanks! EDIT: My fault, they are ignored as long they are empty. They show up correctly once populated.
  7. Hi @bernhard, this is what worked for me: <?php namespace ProcessWire; $wire->addHook('/emit', function ($event) { header('Content-Type: text/event-stream'); header('Cache-Control: no-cache'); $reference = $event->pages->get('/')->page_selector->title; $selector = $event->pages->getRaw("title=$reference, field=id|title|text|image, entities=1"); $result = json_encode($selector); while (true) { echo "event: ping" . PHP_EOL; echo "data: " . $result . PHP_EOL; echo PHP_EOL; ob_end_flush(); flush(); sleep(1); } }); In the frontend then: // Init SSE and listen to php page emitter let source = new EventSource("/sse/emit/"); source.addEventListener("ping", function(event) { getData(event) }); // Retrieve ping data, parse it and pass the result to the resolveData function function getData(event) { return new Promise((resolve, reject) => { if (event.data) { let result = JSON.parse(event.data); resolve(result); } }).then((result) => { resolveData(result) }); } // Resolve data and update alpine data function resolveData(result) { console.log(new Date().getSeconds()); // It logs correctly every 1 sec Object.assign(Alpine.store('sse'), { fragmentShow: true, id: result.id, title: result.title, text: result.text, image: result.image[0].data, imageDescription: result.image[0].description }); }
  8. Hello all! A client asked us to implement a landing page where some content would have to swap in real time when needed. Basically I need to implement a way to select in the backend (via a select dropdown or whatever) which page I want to use as the "replacer", save and then immediately use its html content to swap the old content, in real-time, on the front-end. I've read about htmx and its sse implementation, and also took a look at this simple example on how to dispach an event via php every second. The front-end part looks way easier to implement, but the backend one it's over my knowledge at the time of this writing. I know @netcarver did some test and also @kongondo is playing with those technology a bit lately. This is the first time I came to such a request and I'm looking for some advice from you guys! :)
  9. Now we are talking ? That's what I meant in my previous post, using pw-panels to have some more options capabilities per single, matrix block, field. In your example video (where the panel is used), is there any reason beyond your preference to not have a repeater field in your main editing page? IMHO the real potential benefit would be delegating custom, reusable options (something like a combo field) for each single repeater matrix entry (if needed). Doing so we could de-clutter the interface and gain more clarity for both us and the user.
  10. I really like the idea behind the third approach where every block has its sets of options to work with. I don't really like the way to access them, via a modal interface, even tought I think you've used it since it's the current best way pw gives us to stay in the state of the page edit. One better approach would be to have somewhere a tab (or tabs) for each and every component inside the block (in this case image and text, as for your example) where the options might have their place to live, something similar to what we already have for the rest of the pages. Or maybe, and even better, use the pw native sliding panels to edit the content of each block. Great job by the way!
  11. That can be easily done changing colour variables inside tailwind.config.js as suggested on my previous post. In addition to that it might be useful, for theming purpose, to create a single preset for every theme you want to have, and switch between them per project-basis. More here https://tailwindcss.com/docs/presets Not something possible out of the box as far as I am aware of. Utility variables are top level and not tied directly to custom sections.
  12. I tried to understand your question but I'm missing something for sure. Can you elaborate a bit deeper please? ? As a quick guess, is this page something you were looking for?
  13. I've found myself that the most useful classes are the ones dedicated to wireframe the layout itself, like margins and paddings. Using them in early stages of the blocking phase seem to be the most effective way for me. So I tend to do the opposite of what you are suggesting: utility classes first and layout tweaking with custom rules later (if needed). There is plenty of utility classes I never had to use, and that's ok. This is also true for vanilla css declarations as well, it all depends on the specific project. To me it's not about how many utility classes I would use, but how many of them I can reuse inside a single project, avoding inconsistencies all over the place. Having the ability to tweak them in one single configuration file is a bonus. Of course this is also true if you are smart enough to go with "pure" css custom variables inside the :root selector of your css. This is certainly an option, if you have found something inside Bootstrap, Bulma or whatever is missing from Tailwind. I don't see the point anyway, because with the new jit mode from Tailwind you will have just the utility classes baked inside your "dist" css, without any bloating useless css.
  14. Nothing wrong with vanilla css at all indeed ? For me tailwind is just a tool that makes me quicker to write my css declarations and development in general. Take the above example: .btn { @apply px-4 py-2 rounded font-semibold bg-gray-200 text-black; } In plain css it would be: .btn { padding: var(--margin-tb) var(--margin-lr); border-radius: var(--medium-radius); font-weight: 600; // and this might be a custom property too if needed background: var(--bg-lighter-gray); color: var(--text-black); } It's more verbose I think. I've intentionally wrote css variables to slightly emulate what tailwind does: helping you to create and use a design system, with consistent values at disposal throughout the entire application. Not to mention purgecss, which is included out of the box, and for me it's a no brainer. It drastically reduce the size of the css to be used in production. That being said I always find myself in the situation where I have to write my custom css classes, where defaults values I set before are enough no more and need more control. There is this new option where you can set arbitrary values directly on the html markup (https://tailwindcss.com/docs/adding-custom-styles#using-arbitrary-values) but I'm not really sold and I still prefer to organize them by myself. Having another tool in the box might be convenient from time to time.
  15. It doesn't work because your condition must be inside the foreach loop below, why you need it to be outside of the loop?
  16. I've read the stencil documentation but I'm not sure how much advantages I could have in learning it and how to integrate it efficiently with Processwire. Have you got some pointers for guides/video courses on this topic? Any reccomendations on how mix processwire with stencil (routes and api generation in particular) ? ? Nice animation and flow on the site by the way, good job!
  17. What about this? (not tested) $pages->addHookAfter('saveReady', function($event) { $p = $event->arguments('page'); if($p->template != 'artist') return; if($p->artist_last_name) return; $ln = explode(' ', $p->title); $lastname = array_pop($ln); $p->set('artist_last_name',$lastname); })
  18. Try to change the trigger from "saveReady to "save"? // Before public function ready() { $this->pages->addHook('saveReady', $this, 'afterSaveReady'); } // After public function ready() { $this->pages->addHookAfter('save', $this, 'afterSaveReady'); }
  19. I've used Mailjet (from the same company of Mailgun) and it worked fine for me. 6.000 emails per month for free are more than enough for testing purpose I think ?
  20. Create a new php file inside template folder (or a subdirectory of it, ex. "inc") and paste your html portion you want to include in all the other templates, save it. Then, in all the templates, where you want that portion to appear just: <?php include('path/to/partial.php'); ?> // replace the path with yours.
  21. $featured = $all->find("limit=4, check_featured!={$page->check_featured}"); // Just 4 results here $items = $all->find("limit=6"); // Cannot be 6 here Spot the mistake?
  22. Are you sure you're using the correct syntax? // eg: <img src="<?= $urls->templates ?>img/your_image.jpg"> // $urls is a shorthand for $config->urls
  23. @ryan and @bernhard, you rock! Could you please provide some screenshots of the Reno and Rock themes? Thanks!
  24. Ciao Francesco, bel lavoro! Hi Francesco, good work! I notices a bit of delay on the homepage because the hidden map has to load a lot of tiles/images, I would try to load the map on demand/click to improve the perceived speed of the site ?
  25. Hi @Robin S I have a scenario where a series of pages are protected by LoginRegisterPro, so user can access them upon registration. I'd like to grant access to those pages to some users coming from another website via a query string. It is possibile with your module? Is there a hook where I can redirect to login form if a user could not access the page/s? Thanks! ?
×
×
  • Create New...