Jump to content

dragan

Members
  • Posts

    2,007
  • Joined

  • Last visited

  • Days Won

    21

Posts posted by dragan

  1. I only ever use BS or Foundation just for the grid, mixins and helper / utility classes (.visuallyhidden et al) + normalize (S)CSS. There's nothing wrong with it, and I don't understand people who claim that "every site built with BS looks the same" (or that is has to). It's just a tool. It doesn't dictate anything.

    As for components, I'm cherry-picking and choose the "best in class" (e.g. PhotoSwipe for lightboxes, Flying Focus) or build my own. An accordion or tab component is a trivial thing to build, and at some point (if you have a very custom design) it's easier than tweaking an existing solution. But of course - it all depends... on budget, deadlines etc.

    • Like 3
  2. @Macrura Did you create a template (without file) according to Ryan's "how to" (step 3) ?

    Quote

    Create a new Template (Setup > Templates > Add New). In “Create a new template without a file” input, type in “field-files”, replacing the word “files” with the name of your field (i.e. “field-images”, “field-photos”, “field-downloads”, etc.). Click the “Add Templates” button to save.

    Perhaps you have to only replace _ with - in your template name. From what I gathered, it should be a - character, not _.

  3. @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.

  4. 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.

    • Like 3
  5. Another issue: If I use wireRenderFile(), I get this fatal error:

    Quote

    Exception: Invalid output file location or specified file does not exist. on line: 518 in /home/foo/www/dev.foobar/wire/modules/PageRender.module

    This used to work just fine with the previous version (v.7x), and the assets/file/ folder definitely exists.

  6. 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.

    Quote

    Exception: Cannot find TTF TrueType font file "Inter-Regular.ttf" in configured font directories. on line: 33 in /home/foo/www/dev.foo/site/modules/RockPdf/vendor/mpdf/mpdf/src/Fonts/FontFileFinder.php

    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?

  7. @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).

    • Like 1
  8. 35 minutes ago, Anders said:

    by reading it off the post-it note I so conveniently have on my screen

    yeah well... no matter what system you use, that's a bad idea.

    37 minutes ago, Anders said:
    • Anything more? Any other modules or settings to look out for?

    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?

  9. @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?

  10. @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

×
×
  • Create New...