-
Posts
191 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Mikie
-
Hi @adrian. Been looking into this more. Is it as simple as just adding the preload directive, then browsers fall back or ignore if unsupported? I have have read the articles posted, but am still not clear on that.
-
Hey @jploch sorry I missed this. How’d you go? I am not 100% sure on the above, creating a hidden admin page with a Process module is the simplest way to do it, but i think you can use Ajax with inputfields, like talked about here:
-
This repost of ^ old info makes me feel things are on track ?. Building a site with padloper right now but it’s pretty handicapped. Hey @kongondo another question, will parts of padloper live in thier own custom data store, or is it all in the site db?
-
Sorry for the spam on this post, but I just went through the process of figuring out and setting up the above so I thought this might help anyone interested. Lets say you have: - domain1.com in G Suite with user@domain1.com as a user account - domain2.com that you want to relay mail through GSuite SMTP Add domain2.com to the domains of your G Suite without adding all the MX records, just the txt DNS record for confirmation. You can of course add the MX records as well, but if you aren't going to use domain2 for new G Suite users or as an alias for existing users, then no need. In admin.google.com Apps > G Suite > Settings for Gmail > Advanced settings look for "SMTP relay service" under routing and add a setting like screenshot below. This will let you: - authenticate smtp-relay.gmail.com:465 or smtp-relay.gmail.com:587 using user@domain1.com / password - send mail through GSuite relay as anyadress@domain2.com The only things to note are: - both the above need TLS enabled. I believe if you use 25 without SMTP AUTH you can only send to accounts in your G Suite organisations but I might be wrong, the instructions are quite confusing - to save to your sent box in the account you use for auth you need to enable comprehensive mail storage for G Suite Also I haven't tested this with any of the Processwire SMTP modules, I have a working setup using postfix. Will be testing this with PW soon thought so I'll report back here.
-
Also, to avoid enabling insecure apps in Gmail the recommended method is to enable 2FA on your Google account, then you can add passwords for individual apps.
-
Hey @ryan, I wanted to comment on this blog post but couldn't figure out how. There is a different google smtp service for G Suite users that lets you send mail from custom domains / addresses / ips. It also has huge free sending limits per user per day. Ideally the domain you'd like to send from should be added to your G Suite account, but you can also send from domains that aren't associated with G Suite. See more info here https://support.google.com/a/answer/2956491. I think it would be relevant to flag this as lots of people use G Suite but don't seem to know about it.
-
Above is off topic sorry, I was getting push confused with the http/2 functionality of all resources getting sent async in a single connection (which does happen out the box). Yes, push is confusing and it seems there are no real standards or guidance on how to use it. I feel it is pretty extreme optimisation since after first load things are cached anyway. What would be a candidate for push in PW Admin, assets from unloaded modules or image previews or something?
-
This is all dependent on the server, nothing to do with php as far as I know. If the cache headers are there (which they are for PW admin assets) then it should just work out of the box. See below for one of my sites, all assets h2 brotli encoded and server from browser cache:
-
http/2 + brotil ??. I use runcloud for clients and now apnscp panel for my server, and both do h2 + br out of the box. I still bundle everything tho since not doing so would involve not using any build system which seem crazy to me, plus after first load things should be cached by the browser so it makes no difference whatsoever after that. Realistically images take up much more space and IMO focus should be given to optimising them as much as possible.
-
Is there any way to get the $page->_pageTableParent in the admin? It's set by FieldtypePageTable::wakeupValue and is available on the frontend for pages created by a PageTable field.
-
If anyone hasn't seen it, https://www.11ty.io is pretty amazing for static sites, it gets a lot of things right in my opinion. Much less opinionated than other static generators, allows swapping template languages on the fly throughout or on a page by page basis, and the systems for page data are super powerful and flexible. I just build a startup marketing site with it, a few of the cool things I did were: read filesystem and parse image files to create a globally accessible images object with width, height, ratio data for use with mixins to ouput lazyload containers; parse a csv file to build a really complicated pricing table... no more client requests to change wording on x row, they just edit a google doc I set up for them, I download and drop in the assets folder, rebuild and done!
-
select field type who uses images for preview changes
Mikie replied to Chris's topic in Wishlist & Roadmap
Thanks @LostKobrakai, this is great, exactly what I needed! Just posting a note anyone else using in modern times, I had problems with this inside a matrix repeater with dynamic content. The version of image-picker from 2016 has this line. Straight jquery click doesn't handle event delegation, so for dynamic content you need to use on( "click", ...). The latest version of image-picker fixes this and swapping out the files in the download linked by LostKobrakai above works fine. https://github.com/rvera/image-picker/releases -
Thanks @psy yeah I know about those, it was more an editing workflow thing. Client has 50 + images in a gallery, flagged they were being added to the end not the start. I didnt realise they were using the filesystem select and not just drag dropping onto the field. Having said this, it's interesting that those two workflows for adding images function differently.
-
Hey, I've tried a search but couldn't find anything about this precisely. Is there any explicit setting to add images to the start of an image field rather than the end on upload? I'm assuming I'll need to figure this out with hooks. Please ignore. Noob mistake asking a question from a client, they weren't drag dropping and I had a brain spasm.
-
Cool. Just an FYI in case you aren't aware... modules can create and remove admin pages on install / uninstall, which is where that ajax url would live.
-
Hi, @jploch . Can you explain the workflow, or maybe do a diagram. What I think you want is: - Admin interface uses gridstack.js - In this context (ie your module building on PageTableExtended), each item in the grid contains the child page preview, and the page that is being previewed is where the data for gridstack.js is stored / set If you want to save the data after dragging / resizing an element, I'd probably leverage events from the api here https://github.com/gridstack/gridstack.js/tree/develop/doc and set the data via ajax. To do that you just need an endpoint to send the data to, eg /pw/setgriddata/. Below code is not tested, just an example as I haven't used gridstack.. In the module js file: $('.grid-stack').on('gsresizestop', function(event, elem) { var $elem = $(elem); var data = { width: $elem.data('gs-width'); height: $elem.data('gs-height'); x: $elem.data('gs-x'); y: $elem.data('gs-y'); id: $elem.data('id'); } $.ajax({ url: "/pw/setgriddata/", data: data, }).done(function( msg ) { console.log( msg); }); }); At /pw/setgriddata/: if ($config->ajax && $input->post) { if ($p = $pages->get("id={$input->post->id}") { $p->data_gs_width = $input->post->width; // etc $p->save(); return "Updated page: " . $p->title; } else { return "Could not find page: " . $input->post->id; } } You probably don't want to do this on all resizes however. If you want to do it on page save, again I would probably use gridstack events to populate the input fields you are rendering. Again, very quick... $('.grid-stack').on('gsresizestop', function(event, elem) { var $elem = $(elem); $elem->find(".grid-stack-input#data-gs-width")->val($elem.data("gs-width")); // etc });
-
Hi @jploch, not sure exactly what you are doing, but can't you have hidden fields either on the main template or sub-templates inside the PageTable that you save data to on a hook?
-
Ok, figured it out partly, don't need to change the $parsedTemplate->page->render() call in PageTableExtended since that has lots of sideffects. Just need to capture and return the twig output like so: if($options['pageTableExtended']) { $factory = $modules->get('TemplateEngineFactory'); $out = $factory->render("content-gallery", ["p" => $page]); echo $out; } Now I am having trouble using twig filters / php functions in this context, but I believe that is more a TemplateEngineFactory / TemplateEngineTwig issue.
-
Hi. This module looks really promising for a current job, didn't know about it til now. Does anyone have it working with TemplateEngineFactory / TemplateEngineTwig v2? Eg if a template to be rendered in the admin does either of the below: if($options['pageTableExtended']){ $factory = $modules->get('TemplateEngineFactory'); $controller = $factory->controller('controllers/content-gallery.php', 'content-gallery.html.twig'); $controller->execute(); } if($options['pageTableExtended']) { $factory = $modules->get('TemplateEngineFactory'); $factory->render("content-gallery"); } Only way I can get output in the admin is to change the render method in this this line from: $parsedTemplate->render() to: $parsedTemplate->page->render() Does this make sense, or should i try to hook TemplateFile::render with TemplateEngineFactory for this use case?
-
Hey, would also love this. More links below: Some other options: https://github.com/madebymany/sir-trevor-js https://github.com/vigetlabs/colonel-kurtz https://editorjs.io https://docs.slatejs.org HN discussion on this topic: https://news.ycombinator.com/item?id=19555633 WSIWYG type editor lists: https://github.com/JefMari/awesome-wysiwyg https://gist.github.com/manigandham/65543a0bc2bf7006a487 What bard is build with: https://prosemirror.net https://tiptap.scrumpy.io Maybe we could all band together and buy an enterprise license for froala to allow redistribution: https://www.froala.com/wysiwyg-editor/examples Squarespace, despite being buggy and bloated, is actually quite an amazing application and a good example of complicated layout building ui. At the very least, it would be nice to have a split pane preview mode for matrix repeater that wasn't an overlay, eg like in that bard demo.
-
I double posted somehow. Sorry! Please delete this one.
-
Hi @kongondo, will there be import for orders?
-
Some more info on what I am talking about: https://github.com/Imagick/imagick#openmp https://stackoverflow.com/questions/8413868/imagemagick-thumbnailimage-maximum-execution-time-of-30-seconds-exceeded http://www.daniloaz.com/en/high-cpu-load-when-converting-images-with-imagemagick/ https://www.imagemagick.org/discourse-server/viewtopic.php?t=16453&start=15#p71389 It is interesting because the maintainer of php Imagick suggests images shouldn't even be processed inside a webserver due to these threading issues: https://github.com/Imagick/imagick/issues/263 The only thing that has worked for me so far in my setup (Homebrew installed imagemagick and pecl installed imagick) is adding: \Imagick::setResourceLimit(\Imagick::RESOURCETYPE_THREAD, 1); to my site config.
-
Hey @ryan just hit this again and done some more research, from what I can tell there are longstanding problems on mac with the combination of apache threads, imagemagick, and the parallelization library openmp that magick uses. I am fairly certain installing imagemagick with the flag --disable-openmp should fix things. My problem is that in my setup imagemagick is installed via Homebrew and since it is a core formula I can't provide options on install anymore. I don't want to deal with installing a binary etc, this is pretty frustating since now I might need to create and maintain a tap of imagemagick with openmp disabled just to fix this.
-
HI! I've encountered a problem with the above changes, in that $templateFile->page->template->name doesn't work when checking templates called by the TemplateFile class. The test need to be against $templateFile->filename to work properly in all cases. I submitted an issue on GitHub before seeing this recent conversation, just thought I'd come here to notify.