We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36931
    • 206 Posts
    Dear All,

    I need to do a small thig but it does does not work
    This is my code

    echo $fileName = "images/produits/page_30_0_large.jpg";

    if(file_exists($fileName)){
    echo '<img src="[[++site_url]]'.$fileName.'" title="[[*pagetitle]]" />';
    }else{
    echo '<img src="[[++site_url]]images/produits/no_image_large.jpg" title="[[*pagetitle]]" />';
    }
    The function file_exists returns true, but when I replace the number 30 by [[*id]]
    the function file_exists return false

    Why [[*id]] make trouble?

    Many thank
      • 36931
      • 206 Posts
      Ok, I found.
      In my snipest, I created a variable $page_id

      and in my template I call my snapist
      [[mySnipest? $page_id=[[*id]]]]