Jump to content

dragan

Members
  • Posts

    1,977
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by dragan

  1. @Macrura Did you create a template (without file) according to Ryan's "how to" (step 3) ? Perhaps you have to only replace _ with - in your template name. From what I gathered, it should be a - character, not _.
  2. @Macrura Are you doing a search of some sort? i.e. using a selector? A field name like author_images_randomgibberishstring sure looks strange. Did you name it like that? In "regular" image fields I found the new feature works just fine, also with multi-language. Maybe you are using an image field inside repeaters?
  3. Do you check as logged-in superuser or guest (e.g. incognito mode)?
  4. @matjazp Perhaps you should take a look at Markup Cache or Wire Cache instead. They're powerful tools, and often overlooked.
  5. @Tom. You should bookmark the custom search in my sig (or one of the various others that exist) - you'll find stuff much, much faster 🚀
  6. Maybe you need a recursive function? Take a look here in the PW profile: https://github.com/processwire/processwire/blob/dev/site-default/templates/_func.php#L76
  7. Just update site/config.php If you want to keep the same config.php locally and remote, add a simple if statement or switch/case if ($_SERVER['SERVER_NAME'] === 'dev.mysite.com') { $config->dbHost = 'foo.mysql.db.host.com'; $config->dbName = 'xxxxx'; $config->dbUser = 'xxxxx'; $config->dbPass = 'xxxxx'; $config->dbPort = '3306'; }
  8. Is ACE Tracy's console editor? If so, then ALT-GR works for me (Windows).
  9. @bernhard Thanks for the hints. I didn't notice I was uploading .otf files instead of .ttf - my 2nd facepalm moment yesterday... As to the other issue I mentioned: I found out it's not related to RockPDF at all. I got some really weird issues with render() / wireRenderFile() - but only when I ran my code inside Tracy console. In a regular template everything works as expected. The issue was with matrix repeaters that are called with $child->render('offer_matrix') inside the template, where I use field template files* - suddenly PW wouldn't find these anymore. * site/templates/fields/matrix.php site/templates/fields/matrix/body.php site/templates/fields/matrix/gallery.php site/templates/fields/matrix/slideshow.php etc.
  10. Maybe a directory traversal attack (to install backdoors or whatnot). I would immediately contact the hosting company, and also check for suspicious files. Lock down your forms, or any other potential areas that allow user-input.
  11. Another issue: If I use wireRenderFile(), I get this fatal error: This used to work just fine with the previous version (v.7x), and the assets/file/ folder definitely exists.
  12. Yeah... using inline SVGs works just fine... until you want to style fills or strokes via CSS. I have updated rockPDF just now, and noticed that there's something buggy with using custom fonts. I have the fonts both in site/templates/fonts/ as well as in site/assets/RockPDF/fonts/. I have now also placed them in site/modules/RockPdf/vendor/mpdf/mpdf/ttfonts, cleared modules cache, but the error persists. I've looked into the module code, and presumably somewhere here the paths are defined: public function init($options = []) { // make sure the assets folder exists $this->wire->files->mkdir($this->wire->config->paths->assets . $this->className . '/fonts', true); $this->settings($options); } public function settings($options = []) { // merge defaults $defaults = [ 'tempDir' => $this->wire->files->tempDir('RockPdf'), 'fontDir' => [ __DIR__ . '/vendor/mpdf/mpdf/ttfonts', $this->wire->config->paths->assets . $this->className . '/fonts', ], ]; $options = array_merge($defaults, $options); Any clues how to fix this?
  13. Sorry, didn't fully read your post (re: SVG) - pls ignore this post.
  14. This is not a question about PHP, but a matter of your frontend. You should look into the Cache API, indexedDB and service workers. What you probably want, it to build a progressive web app. https://github.com/pazguille/offline-first https://ponyfoo.com/articles/backgroundsync https://www.twilio.com/blog/2017/02/send-messages-when-youre-back-online-with-service-workers-and-background-sync.html https://github.com/pulseshift/lunch-pwa https://github.hubspot.com/offline/docs/welcome/
  15. @cosmicsafari Well, you could take a look at the BCE module... Did you look at server logs? Did you also try with a very small CSV file - maybe it's not the size of the files, or the time it takes to process everything, but some stumbling blocks in your code ? I would first try it with adding output formatting set to false, and then also use sanitizers (you can never trust user input), or at least trim(). I also noticed this line $p->name = $name.'('.$lat.','.$lng.')'; which doesn't look OK. PW page names can't have special characters like (). Use the page-name $sanitizer and get rid of the () (or any other non-allowed characters).
  16. yeah well... no matter what system you use, that's a bad idea. Tracy Debugger can wreak havoc if used by non-trusted users (terminal, Adminer, console etc.). But you don't want to remove and install it again each time you log in as legitimate superuser, do you?
  17. @hollyvalero I tried it as well (hook is also in site/ready.php), and everything works just fine. Just copy-and-pasted the hook, and used the list example, and adjusted the selector. It even works within a partial I load via include_once() and cache the output with MarkupCache 🙂 Do you run an ancient PHP version, by any chance? See Ryan's note about PHP < 5.3 Also, did you find any hints with Tracy Debugger?
  18. @Marco Ro If you would draw a little sketch, and show exactly what you want to do, and how it's supposed to look like visually (it's still not clear to me from your description), maybe there is a way with CSS only. And perhaps also show what it looks out now, out of the box, for comparison. e.g. if all you want is to place the label on the left, and the input on the right, you could do it easily with flexbox: https://codepen.io/dragan1700/pen/JjdRYVE
  19. @Marco Ro Why do you want to change that? And what's the situation? Do you use PW's inputfield form to create forms in the frontend? Do you want to re-style the labels and/or input fields? Maybe there's a CSS solution? Or is this even something from FormBuilder?
  20. You don't need PHP at all. I'd suggest to use Google Optimize (and a linked Google Analytics account where you set up your goals) instead. Here's a nice tutorial. (you can skip more or less to step 3 "Create an Experiment" - and make sure you also include the "anti-flicker" stuff at the end of step 2)
  21. I agree too that this should be added to the styleguide, and I also configured my IDE to strip trailing whitespace on save. However, if we're talking about diff tools, it's just as easy to configure them to ignore whitespace (and even empty lines). PHPStorm Git has the option --ignore-whitespace you can use. VSCode: File => Preferences => Settings => Diff Editor => Ignore Trim Whitespace.
  22. @joshua Nice! Thanks for sharing. Can this module be used for multi-lingual sites? i.e. If I wanted to translate the banner texts and labels, is that possible out of the box? Or would I have to manually re-define the module's text fields as text/textarea language?
×
×
  • Create New...