Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by DrQuincy

  1. Oh wow, you are amazing, LOL! That worked great. The only downside I can see if that I can't see a way of having a dynamic number of rows in the Google Doc. So I have to paste more than I need for the update to work. E.g. If I paste 10 rows in the Doc that limits it to 10. That should be okay but am I missing something that would allow me to have any numbers of rows pull through?
  2. Hi all, This is nothing to do with PW… I have some data in Google Sheets. Do you know if it's possible, ideally without having to use their API, to create Google Docs that automatically feed in data from certain sheets/cells. E.g. A Google Sheet has a list of addresses that have address in one column and a “type” flag attached to them (e.g. rural, suburban, urban). Let's say there are 3 x types as mentioned. Is it possible to have 3 x Google Docs that feed in addresses filtered by type? And, ideally, if the data is updated in the Sheet it automatically progates into the Docs. Can this be done? I have had a look but can't find anything. It looks like they have a decent enough API but it looks like it would take more work than I have time to spend on it. Thanks.
  3. Thanks! So I guess since that github comment is ~3 months old you have to be on a fairly recent version for the performance increase.
  4. When you access an image from the API you can get the width and height with $imade->width() and $image->height(). When you run these internally does ProcessWire get the sizes from the database or does it actually use GD to get them? I'm assuming if you aren't creating variations on the fly it just reads them from the database (the schema has width and height columns). Just checking that there won't be any significant overhead if doing this on lots of images.
  5. I have a site that has a parallax fixed banner at the top and then the rest of the content goes underneath with a higher z-index. It works great but when — on a Mac at least — you scroll quickly down to the bottom of the page it scrolls beyond the height of the document body and then snaps back and for a breif moment you can see the fixed banner underneath. Is there a CSS property to prevent this?
  6. Thanks! Looks like there are a few LG Ultra Fine options. There's a secondhand 22" one at 4096 x 2304 on eBay at a decent price. Perfect!
  7. I want to get an external display for my new 24" iMac. I don't want something huge but I want it to be retain display. It seems like most monitors out there are either about the size I want (20"–24") but they are “full HD” (only 1080). Or 4k, which is a better resolution, but the screen sizes are huge! Without getting an Apple Studio Display or LG Ulttrafine, does anyone know if a 20"–24" display that is also retina?
  8. I've got this code: $field = wire('fields')->get('mySelectOptionsField'); $options = $field->type->getOptions($field); echo $options->first()->title; The echoed statement is not HTML-encoded. However, when you get select titles from $page rather than from $fields the title is HTML-encoded. I get that this is intended behaviour. I just wanted to check: When in the front-end and using the API is the general rule anything you get via $pages or $page has of set to true by default but anything else — such as my example above — there is no output formatting since that only applies in the context of pages Is there an in-built way to HTML-encoded from $options as above — or should I just used $sanitizer->entites()? Thanks.
  9. Interesting, you learn something new every day! I'll bear that in mind for next time. I think I was put off by this: Since I was reading and writing quite complex models I was more comfortable using JSON and sharing data that way.
  10. I believe bootstrapping for when your other script is not already a PW instance, including command line (I have used that on a project before, by the way, and it's very useful and easy). With the multi-instance option, due to the PHP namespace, you can only write to the main instance. You can read from as many others as you want but you can never save anything as when you run new \ProcessWire\Page you are always creating a page in main instance's namespace. In my case, I needed to read from the main instance and write to the secondary one so it wouldn't work for me. At least that's how I understood it! I couldn't see anything in the doc that allows you to create new pages in secondary instances.
  11. Thanks for confirming. Yes, I am currently using a Textarea rows="1" and removing line returns on save so it effectively does the same thing.
  12. I have a Table field that I am using for some spam filtering. I have one field in the table set as a Text field. If I enter <a href=" and save it becomes blank regardless of any text formatters applied. It's weird because if I do the same with a Text field that is not part of a Table field it works fine. And within the Table field if I change it from Text to Textarea, it works. Any ideas why? Thanks.
  13. The client basically has two sites. One is in the UK and the other in the EU but serves customers internationally. There is a lot of shared information on both sites but at the same time they are different enough to warrant individual sites. But the client didn't want to, for example, add (and keep up-to-date) the same product twice. What I have set up is a root site that doesn't have a front-end but stores all the shared data. Then there is a folder for each site within that, each a separate PW instance. /root/ /root/uk/ /root/eu/ My question above was really to see if I could copy info between the sites within the same script. While Robin S's link was useful, it would appear to be for read-only so I didn't end up using it. Instead, the root site has hooks that saves all data into JSON files and associated assets and the EK and EU then take the and convert it to PW pages. If you're wondering why the EU and UK sites are within the root site folder as opposed to being siblings, it's because they share the same templates, models, JS, SCSS, etc.
  14. Great, thanks! I notice is says “Development version, not yet recommended for production use” so I'll have a play with it first. 🙂
  15. Oh wow, thanks. That looks (as everything tends to be with PW) so simple!
  16. If I had sites A and B is there a way in site A to create an instance of ProcessWire\wire() that is connected to a completely different site? The reason I ask is to sync some data between two different sites on the same server on the fly. E.g. on site A: $page1 = wire('pages')->get(/foo-bar/); $page1->of(false); $page2 = new \ProecssWire2\Page; $page2->template = $page1->title; $page2->title = $page1->title; // and so on $page2->save(); // Saves to site B
  17. Just that really…I searched the module directory and couldn't find anything. Is there a way to export a single page into a zip (with something like a JSON or SQL file along with all file assets) which can then be imported.
  18. I want to manually render a string as markdown (TextformatterMarkdownExtra). How can I do this? E.g. This is _a_ string becomes <p>This is <em>a</em> string</p> Thanks.
  19. Thanks, I'm inclined to agree. I have being playing with cookieconsent this morning and it's really good.
  20. What's the general consensus for users with JavaScript disabled? Solutions are naturally JS-based and indeed most cookies would be set via JS and require JS to run. However, many scripts, such as Google Analytics, also give you an noscript image or iframe to install. How do you handle this? I presume they are still take people's IP and using it for tracking and therefore it's personal info under GDPR.
  21. Thanks everyone for the useful replies. There's lots to go through, it's all very helpful thanks. PrivacyWire looks very interesting and also easy to implement. I also like the look of https://github.com/orestbida/cookieconsent#how-to-blockmanage-scripts as it looks like you can accomplish the same thing independent of the platform (I have a lot of legacy sites that aren't PW). I think that will suit most smaller clients. Cookiebot looks reasonably priced and seems to have all the features so I suspect my bigger clients may go or this. Thanks everyone!
  22. Hi, I work for UK and EU clients. I remember about five years ago when GDPR came in there was a panic due to the potential fines and the things people did ranged from nothing at all to extreme UX disasters where the first thing you saw was a huge popup giving the user the opportunity to break the site. Since this is a legal area and I am not qualified to do so I do not give clients any advice in this area but will implement whatever kind of policy they decide on. To date many clients are happy to have a cookie notice that acts as a warning rather than manage specific cookies as it saves them disabling Google Analytics, paying for legal advice, etc. A client has raised a concern that since 2019 we should have started giving users the option to disable different types of cookies and therefore the above approach does not meet this legal requirement. Anecdotally, many small sites either do nothing at all or have a cookie warning as above. It seems to be a minority of sites, generally bigger ones, that allow for full on cookie management (i.e. blocking of non-essential cookies) and therefore are likely in a small group that are fully compliant. I've had a quick look today and am unsure on how to implement this. Am I right in saying there are two primary ways: Use a paid third-party service that scans your site for scripts that uses cookies; this handles the popup and management for you Use a jQuery/JS plugin that handles the interface but not the cookie blocking — you do this yourself It also looks like there is a WordPress plugin for this that WP users can use. Do these work like option 2 above or can they actually scan your site? Are there any PW or JS plugins that I should be aware of that can help me out here? I'm just after a bit of general advice from anyone who has PW sites and has implemented cookie management. Thanks.
  • Create New...