Jump to content

OLSA

Members
  • Posts

    151
  • Joined

  • Last visited

  • Days Won

    2

Community Answers

  1. OLSA's post in Image upload problem - stop at 99 percent (2.5.29 dev) was marked as the answer   
    I found temporary solution and that is in connection with JSON response (because of that uploads stop at ~ 80 - 99 percent and can't finished).
    Very important part is that I have this problem (in admin/back-end) when debugging mode is switched on:
    // site/config.php $config->debug = true; Or, if debug mode is off everything works fine - no problem when PW api need to resize uploaded image.
    But, because debug mode is ON, in JSON response (only there) I have also details:
    Permission denied in ***\wire\core\Functions.php on line 254 Undefined variable: pathname in ***\wire\core\WireTempDir.php on line 170 Result of that is javascript error (strange JSON response) and "view" part is "incomplete" (progress bar stopped, and image doesn't show).
    Currently my temporary solution for this (Windows) problem are two simple steps:
    1. wire/core/Functions.php, function wireRmdir(), at the end add something what I don't like to use, but it's works - "@" error control operator
    // wire/core/Functions.php // function wireRmdir() // line 254 return @rmdir($path); 2. wire/core/WireTempDir.php, function remove(), define $pathname
    // wire/core/WireTempDir.php // function remove() // line below 134        $pathname = ''; Windows, wamp, PW 2.5.29 - debug mode ON - backend - problem to upload images wider than "Max width for uploaded images"
    Regards,
    Sasa
  2. OLSA's post in Widgets and page field was marked as the answer   
    Yes and thanks for this, because that's help me.
    What I want is that widgets (partials) need to be last in processing - and - widget can be any kind of content type (template).
    Also, I know that all this can be done using some checks (function) and with known path to some partial (eg. $config->paths->templates . "banner.php" ) - but I want flexible principle inside main layout template file, and use at least possible logic for that job (later some new partials can be easily added to some new pages - without coding).
    And @ Jan Romer, in my case _main.php is appended, and because I neglected that very important part - I get website loading problem. 
    Finally I solve my problem when added 'appendFile'=>null to render() options.
    // _main.php // main layout template file // appended $widgets = $page->widgets; if(!$widgets || !count($widgets)) $widgets = $homepage->widgets; foreach($widgets as $widget) {   echo $widget->render('', ['appendFile'=>null]); //'appendFile'=>null } With this I get desired result, very simple can add different content type widgets (partials, banners) to different pages.
    Best regards and thanks!
×
×
  • Create New...