Jump to content

lecrackffm

Members
  • Posts

    47
  • Joined

  • Last visited

Posts posted by lecrackffm

  1. 15 hours ago, pwired said:

    Yes, invisible format characters can mess up your website and drive you nuts because you can't trace the cause in a logical way. Coding with the right editor is crucial. For example the bluefish editor does not reveal invisible format characters but notepad++ does !!

    yep, took me about three hours from tracing to solution..

    i thought an IDE like phpstorm would be at least sophisticated enough to inform me about these little suckers.. ?

    Lesson learned anyways. Nice weekend to everyone!

    • Like 1
  2. @flydev thanks.

    i reopend all files with Sublimetext 3.. found nothing.

    Then i  begun to open all files with VSC.. and there i finally found ��������  behind the <html> tag.

    I have no clue how they ended up there nor what funky encoding they are, but deleting them finally solved my problem.

    • Like 2
  3. Hey all,

    i do, most probably have a problem with file encoding and / or BOM. 

    My <head>  content is getting moved into <body> and i can inspect a couple of &#65279;  ( ZERO WIDTH NO-BREAK SPACE) chars with dev tools.

    I checked all template files with phpstorm, they are all in utf-8 w/o BOM.

    The current installation is based on a profile i exported from another project where i had not such problems.

    However, in the new project i did change the default language to german and installed english as the second language. 

    Might there be any conflicts with the language support modules?

    Hints, tips or solutions are highly appreciated ?

  4. @wbmnfktr sure, here is the code.

    <?php $items = page()->repeater_home_gallery; ?>
    <?php foreach ($items as $i):   
    	$ratio = $i->gallery_ratio->title;
        		switch ($ratio) {
                 case "portrait":
                    $w_l = 494;
                    $h_l = 618;
                    break;
                  case "quad":
                    $w_l = 494;
                    $h_l = 494;
                    break;
                  case "normal":
                    $w_l = 494;
                    $h_l = 330;
                    break;
                }
        $image = $i->image_single->size($w_l, $h_l)->url;
    ?>
     <img class="uk-width" src="<?= $image ?>"  >
    <?php endforeach; ?>

    What grinds my gears is that it works on localhost.. 

  5. Hi everyone, 

    currently im developing a photographer portfolio-website.

    Since i deployed it to a live server the API creates a 0x0 version of the each image, which are then correctly downloaded by the browser. 

    (Instead of the appropriate image, specified in the CSS)

    However, this only happens for guests and other Users (non-superusers).

    Oddly, this only happens on the homepage. On all other pages, the Images are loaded correctly. I already checked the permissions in processwire and on the server. Afaik they are all correct, allthough i am not the biggest expert in that regard.

    Any help / ideas are highly appreciated ?

     

  6. This looks very nice @Noel Boss,

    is there a way to support repeater fields?

     

    EDIT: Sorry for my silly question, found it in your docs.

    This works for me:

    $query = ['repeater' => function($page){
            return array_column($page->get('repeater')->each(['key', 'body']), 'body', 'key');

     

    • Like 1
    • Thanks 1
  7. Hello,

    since yesterday i am not able to make any new PW installs.

    The Installer stops where it should delete unused files etc..

    MAMP with PHP 7.1.12

    I switched on Test Mode:

    warning: Cannot modify header information - headers already sent by (output started at /Users/**/**/**/**/wire/modules/AdminTheme/AdminThemeUikit/install-head.inc:8) in /Users/**/**/**/**/index.php on line 41

    Can anyone help?

    Thanks

    EDIT: using wireshell i am able to make fresh installs.

     

  8. Hello, 

    after working with PW for a while, im still unsure sometimes,  how to structure certain Data.

    In this case it is a List of Members.

    Each Member consists of his name and a list of his duties.

    In the template file i need separate access to the name and the duties 

    I was thinking about a Repeater Matrix with one textfield for the Membername, and a textarea with newline to UL for the duties?

    What do you suggest how to structure the Data in the PW template ? Is there a better way?

    Tips and suggestions more then welcome.

    Thanks

  9. Hello,

    i am trying to integrate a manfiest file into my PW page.

    But it seems like file_get_contents is disabled somehow.

    <?php 
    $manifest_path = 'path/to/manifest.json';
    $hashes = json_decode(file_get_contents($manifest_path), TRUE);
    $css_hash = $hashes['main.css'];
    var_dump($css_hashe); // works only outside of of processwire. 
    ?>  

    whats the correct way to include a file like this into PW?

    Thanks for your help.

  10. Hello everyone, 

    how can i detect if i am coming from the home page of my site.

    I am trying to make my page ajax driven. The problem is, that the homepage has a different header then all other pages.

    So in addition to  $config->ajax  i need to check if the previous page was the home page.

    Otherwise i am ending up with the wrong header on all other sites.

    Thank you and have a nice weekend.

  11. @SamC

    I would consider myself a beginner in JS as well. There is always more to learn.

    Here is another resource, which helped me a lot to understand the core concepts of JS.

     

    Disclaimer:

    These are only the first 3.5 Hours. The full video is only  available through a paid online Service.

    • Like 2
  12. I figured it out: 

    While using Axios.post() one has to set the Header explicitly to: 'X-Requested-With': 'XMLHttpRequest'

    Just in case someone is facing the same Problem in the future:

    axios.post('/pathTo/script/', yourData, {headers: {'X-Requested-With': 'XMLHttpRequest'}})

    Have a nice weekend.

    • Like 2
  13. Thanks for your looking over my code @thor.

    What i was looking for is securing the site by using 

    if($input->post->action == 'send'){}

    but it seems not to work with when data is send via Ajax? 

    i also tried using 

    if($input->ajax) {}

    but this is not working either.

    I always end up in the else condition if i post the data. 

    I am pretty sure there is, as always,  a pretty simple solution to my problem ??

     

×
×
  • Create New...